Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Nested Transactions
PostPosted: Thu Sep 25, 2003 1:04 pm 
Beginner
Beginner

Joined: Tue Aug 26, 2003 9:50 am
Posts: 34
Location: Weiden Opf. / Germany
Are they supported by Hibernate?

The questions is, if i have code liked this:

Transaction tx = null;
try {
tx = hibernateSession.beginTransaction();
Transaction nestedTx = hibernateSession.beginTransaction();
persistentObject.changeValue("newValue");
nestedTx.commit();

.... more business logic ....
tx.commit();
}
catch (Exception ex) {
if (tx != null) {
tx.rollback();
log.error(e, e);
}
}

Will the tx.rollback() roll the nestedTx back as well?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 25, 2003 3:55 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
No.

Read http://www.hibernate.org/hib_docs/reference/html/transactions.html


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 26, 2003 4:43 am 
Beginner
Beginner

Joined: Tue Aug 26, 2003 9:50 am
Posts: 34
Location: Weiden Opf. / Germany
ok, thanx for the quick answer!

kind regards,

torsten


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

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.