-->
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.  [ 2 posts ] 
Author Message
 Post subject: ctx.setRollbackOnly()
PostPosted: Thu May 19, 2005 10:29 am 
Newbie

Joined: Tue May 17, 2005 10:55 am
Posts: 7
Hibernate version: 2.1

In an EJB, to roll back a container managed transaction should I use:

A) ctx.setRollbackOnly();
Or
B) tx.rollback();

(tx being a Hibernate Transaction and ctx being a SessionContext.)

The Hibernate API says that tx.rollback() will "Force the underlying transaction to roll back."

But as I'm using CMT, will it really just do ctx.setRollbackOnly() ??

Thanks.


Top
 Profile  
 
 Post subject: Re: ctx.setRollbackOnly()
PostPosted: Thu Jun 16, 2005 1:48 pm 
Newbie

Joined: Wed Feb 04, 2004 7:12 am
Posts: 18
Location: Brasilia - Brazil
sdm wrote:
Hibernate version: 2.1

In an EJB, to roll back a container managed transaction should I use:

A) ctx.setRollbackOnly();
Or
B) tx.rollback();

(tx being a Hibernate Transaction and ctx being a SessionContext.)

The Hibernate API says that tx.rollback() will "Force the underlying transaction to roll back."

But as I'm using CMT, will it really just do ctx.setRollbackOnly() ??

Thanks.


Yes, if you're using CMT, the correct way to rollback is calling ctx.setRollbackOnly.

_________________
___________________________
[ MediaSonic (www.geleira.org) ]


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.