Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Problems with Session and transaction handling?
Read this:
http://hibernate.org/42.html
I am using CMT (SLSB) and getCurrentSession() api. In the SLSB, if there is an exception thrown, it is caught and the transaction is setRollbackOnly. I am not sure how hibernate handle the hibernate session and database connection in the case of transaction rollback. I suppose hibernate will cleanup the connection and session for us. But one of my coworker who came back from hibernate training said that this is not the case. He said you had to close the hibernate session in your own application code. Otherwise you would have leaked database connection problem. Is that true? If so, what is the best way to gracefully clean up the sessions. We don't have direct access in the ejb to the hibernate sesssion.
Please give advice.
Thanks.
Richard