-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: strange use of transactions?
PostPosted: Wed Dec 15, 2004 7:28 am 
Newbie

Joined: Wed Dec 15, 2004 7:09 am
Posts: 1
Hi,

I have to analyze and improve a pretty complex web application which sometimes has unexpected behaviour...

Sometimes code looks like this :

Transaction transaction = session.beginTransaction(); // jdbc transaction
try{
...
session.save(object);
transaction.commit(); // commit 1
...
session.save(object2);
transaction.commit(); // commit 2
}
catch (Exception e)
{
if (transaction != null)
try
{
transaction.rollback();
}
catch (HibernateException e1)
{
}
...
}

So, as you con see, several commit are made on same transaction, with possibly one rollback at the end.
Can someone tell me how Hibernate/JDBC behave to this? Is the rollback abort all the transaction or just from the last succeeded transaction commit? Is this way of using transactions is to blamed?

Thank you for any answer.

Manu


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.