Sorry, im a relative newbie to hibernate. My service is behaving a little strange. Here are the sequence of events
1) Save an object (create session, session.beginTransaction, transaction.commit(), session.close)
2) Save a 2nd object, whichcauses an exception, because of a unique constraint I have on one of the table columns (create session, session.beginTransaction, EXCEPTION THROWN, transaction.rollback, session.close)
3) Save a 3rd object (create session, session.beginTransaction, transaction.commit, session.close)
The problem is at step (3). The transaction is not committing to the database after step 3. As a result
a) If there is a 4th event, that causes an exception, both step 3,4 get rolledback
b) The only time step 3 gets commited is when a 4th transaction commits
It seems like the same transaction is being reused for steps (3,4). Any suggestions?? I am using MySql4
- Vivek
|