Dear Experts,
recently I faced a problem in Hibernate complaining the session is closed whenever I called transaction.commit. Digging on the code, I found the culprit is actually a function (function A) that did not commit its transaction. The problem would occur if I call the function A several times then call another function that involve database update, then the error would occur.
My query here is, even though I resolved the problem by committing the transaction in function A, however, I would like to find out why is it by not 'committing the transaction, I could have the 'session is closed' error?
How is the exact life cycle of the session-transaction are handled in Hibernate?
|