-->
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: Committing outside a Global XA Transaction
PostPosted: Tue Oct 11, 2005 5:25 pm 
Regular
Regular

Joined: Tue Nov 11, 2003 7:35 pm
Posts: 63
Using Hibernate 2.1.8 with Weblogic 8.1 and Oracle 9i, configured with JTATransactionFactory and WeblogicTransactionManagerLookup.

I have been all over the forums and internet and cannot seem to find information about the following situation.

I have a long running process that runs 30 seconds to a few minutes in a web application. It is required that only one user be allowed to run this at any one time. To ensure this, what I would like to do is keep a flag in a specified record in an Oracle database which would be set to Y with Hibernate when a user is using the function, and be set to N when finished. This would block out any other users from using the function at the same time an function as a lock. (The web application is clustered so a synchronized block would not work.)

The problem is my application uses JTA XA Global Transactions using Weblogic. The transaction begins when the request begins and does not commit until the request is finished. So even if I set the flag to Y at the beginning of the process, no other process will see the change until the process is done. Even if I try to commit the hibernate transaction explicitly it does not work, and results in an exception saying that one transaction cannot be committed multiple times.

I also tried to get the weblogic TransactionManager explicitly and call suspend() and resume(), with beginning and committing the new transaction created in between. This did not work either, as it seems even this new transaction was really part of the global transaction. (Also, this would have required going around Hibernate's wrapper abstraction for transactions, which is probably not the best thing to do)

So, I am at a loss how this can be accomplished, if it can be at all. Anyone know how to do this, or offer an alternative?

Thank you,
Daniel


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.