JPA 2.0 disable session cache for unit tests
问题 I am writing unit test for my services e. g. : @Test @Rollback(value = true) public void testMethod() { // insert test data myService.Method(); // read/write from DB // asserts go here } While application running, a new transaction is created every time method A entered. But during the unit test execution - when test testMethod entered. So method A doesn't create new one. For proper testing I need to clear cache before every call to service inside test.I don't want to write Session.clear()