From: Chandrasekhar A. <Cha...@ph...> - 2003-09-10 17:44:04
|
I have a transaction like this Transaction tx = sess.beginTransaction(); sess.save(obj) sess.connection() // and one prepared statment execution here sess.update(obj1) tx.commit(); How ever the sess.save() in line 2 and sess.update() in line 4 are getting executed at the time of commit when I call tx.commit(). but the prepared statement execution is done immediately, my prepared statement execution depends on sess.save() in line 2, but since line 2 and line 4 are executed after my line 3 related code Iam getting a foreign key exception in my code, because by the time I execute linke number 3 here code assumes the line 2 has been executed and the entry has been made on the table. Is there a way I can tell hibernate to execute line 2,3,4 in sequence and not to wait till tx.commit() or other way can I can hint hibernate not to execute line 3 until commit time ? Thanks Chandra |