gavin wrote:
flush() certainly does NOT commit the transaction!
Code:
session.setFlushMode(FlushMode.COMMIT);
That looks kinda wrong. There is no Hibernate Transaction, so FlushMode.COMMIT is equivalent to FlushMode.NEVER. Still, you call flush() manually, so it should not be a problem.
That's why I ask this question :) As I found in Hibernate docs, flush must not make commit() in JTA mode. But it does :( . May be there's something wrong with my hibernate configuration? (I do have <property name="jta.UserTransaction">javax.transaction.UserTransaction</property> in my the property file).
My idea : to have multiple EJB methods that will create its own transaction if called alone or use transaction that was created before...
PS. i tried not to use FlushMode.NEVER - it changes nothing :(