TestNG and JPA not sure what's going on... but my test fails
I am running some persistence tests and when I use the method create or create-drop... my test fails when I use update it succeed.
My test is composed of 2 methods, one creates an user in the BD the other method searches for this user.
Both are @Test and I an using Groups and DependsOnGroups to make then execute in the order I need.(insert before search)
What I hav开发者_StackOverflow社区e noticed is that when the second test runs the table is empty... does Hibernate cleans the tables after every test ? why does it work with update in Hibernate settings ?
My guess is that your first test isn't flushing to the db. Try explicitly flushing.
session.flush();
精彩评论