-->
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: Weird CMT/BMT transaction behaviour
PostPosted: Sat May 06, 2006 7:02 am 
Newbie

Joined: Sat May 06, 2006 6:57 am
Posts: 1
Hello,
I am experiencing a problem whereby I begin a new transaction and attempt to save an object, I run into a RollBackException. The code for persisting my object is roughly the following:

Session s = sfac.openSession();

org.hibernate.Transaction tx = null;
try {
tx = s.beginTransaction();

s.save(batch)

However, upon calling save() I consistently get an exception informing me that the transaction has already been marked for rollback. (It might also be of importance that upon calling s.beginTransaction() a WARN is given by TransactionImpl: Transaction TransactionImpl:XidImpl[FormatId=257, GlobalId=Inspiron-Nick/72, BranchQual=, localId=72] timed out. status=STATUS_ACTIVE). tx.wasRolledBack() also does not indicate that the transaction has been rolled back.

Now, the highly strange thing is, I can only replicate this if I have just called a CMT bean (in a completely separate client call) which throws a test exception I have generated (this is *all* it does) and hence marks its CMT transaction for rollback. This has me baffled because I cannot see how the two transactions should be related (other than the fact that they are running in the same JBoss container).

Is it possible in some way that beginTransaction would load up a JTA transaction that has yet to tidy up, instead of producing a new one?

Now, to try and isolate the problem, I used a JTA UserTransaction from JNDI instead of the code above - and this completely fixed the problem! I was not able to replicate it at all using

I am using hibernate 3.1.3, running on JBoss 4.0.3SP1, attached to MS SQL Server 2000.

Any feedback or insight into the problem would be greatly appreciated: I've only started using hibernate over the last month and want to be certain I haven't misunderstood some key concepts.

Regards,
Nick


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.