avihaimar,
I can only suggest generalities without knowing the code in depth, but this migh help somehow:
- it makes sense that Hibernate perfoms a flush before a query, even if you didn't call it explicitly, because Hibernate promises to always return fresh data on a query.list();
- remember that Hibernate generates class proxies, therefore a breakpoint on a class won't necessarily be hit. Use logging instead. It is less gramorous, but more reliable.
- your code should not depend on a session to be flushed or not for Hibernate to "realize" an object has been deleted. Remember that, unless you flush and commit every step of the way (unlikely in a managed environment), Hibernate performs the database operations in a fixed sequence according to the type of SQL operation (see documentation 10.10: flushing the session)
_________________ Gonzalo Díaz
|