-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Database not cleaned up after test #47
Comments
I'll try to take a closer look at it in the next few days. It looks like the |
which JPA provider and which DB are you using? I just did a copy&paste of your code above and with JPA 2.1 hibernate implementation with h2 I receive a "1" each time. |
One additional thing: The transaction "closure" encloses the entire test, including the setup ( I see a benefit of having a more fine grained control, which is not given yet. #33 addresses such functionality. To enable that means however a pretty huge refactoring of the existing code base, so I don't know, when it will be available. |
OK, thanks for the explanation. I will then try to use the I'm stuck with an ancient Hibernate 4.2.11 and and JPA 2.0 but I'm planning to update soon™ to up-to-date versions. The DB I'm using is HSQLDB. |
You can also use the
in your Please try it say if it helps. If I can find some time, I'll check the functionality with you "ancient" setup :) |
Unfortunately, your suggestion didn't work either. I get the same result as before. |
is it possible for you to send me your test project for better analysis? |
Sorry for the long delay, but here's a test project that reproduces the issue. |
When I run the following code I would expect that the database is always cleared after each test and so the results of
test1()
andtest2()
would be the same. Howevertest2()
returns two elements instead of the expected 1.Is there anything that I'm missing here? I tried with several combinations of the
@Cleanup
and@Transactional
annotations at class and method level, but the result was always the same.The text was updated successfully, but these errors were encountered: