At the end of a bunch of hibernate calls I commit my JTA transaction, which calls org.jboss.hibernate.session.TransactionSynch.beforeCompletion(). Inside this method I see that session.flush() is called, and it's failing for me because of a db integrity constraint, which is fine. However, the caller doesn't know that it failed because this method just catches the error and logs the warning.
How am I supposed to know that the session failed to synchronize with the DB and that I should rollback the transaction? Am I going about this the wrong way completely?