We have a servlet to serve many concurrent requests and sometimes some request throw exceptions. I saw this warning from Hibernate guide:
"If the Session throws an exception, including any SQLException, immediately rollback the database transaction, call Session.close() and discard the Session instance."
In my real scenario, a request has made many important changes to DB and when we caught an exception, we must rollback all changes have made before.
So it seems we must implement the transaction-per-request pattern instead transaction-per-query to sure all changes are going to be rolled back.
It's right?