Thanks, it worked. -----Original Message----- From: Gavin King [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 10, 2003 11:21 AM To: Chandrasekhar Ambadipudi Cc: '[EMAIL PROTECTED]' Subject: Re: [Hibernate] Question on Session.connection
Just call sess.flush() ... you can call it at any time :) Chandrasekhar Ambadipudi wrote: > 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 > > >------------------------------------------------------- >This sf.net email is sponsored by:ThinkGeek >Welcome to geek heaven. >http://thinkgeek.com/sf >_______________________________________________ >hibernate-devel mailing list >[EMAIL PROTECTED] >https://lists.sourceforge.net/lists/listinfo/hibernate-devel > > ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel