Simple question. The simplest answer to that may be “It depends.”.

But let’s explore that aspect a little further and please keep in mind there is no absolute truth despite what pages upon pages of heated online discussions might suggest. In addition to that we also have some fully-working, juicy sample code for you to ogle over.

We’re talking about @Transactional in a Spring based project context. Obviously the same holds pretty much true for your J2EE project.
So what does @Transactional mean if you annotate your test suite with it? Well it means that every test method in your suite is surrounded by an overarching Spring transaction. This transaction will be rolled back at the end of the test method regardless of it’s outcome.