lundi 15 août 2016

The tests of DAO layer should be transactional or not?

In our project recently when create the test DAO layer doubt whether we need them to be transactional or not. We clean the database and return it to fill in an initial state in each test method, so we are not sure if it is needed to be transactional.

I've seen different examples and appears recently there are too many tests annotated with @Transactional for example the samples of Spring-projects in github are annotated with @Transactional.

So, In which cases the test should be annotated with @Transactional and why?

Aucun commentaire:

Enregistrer un commentaire