-->
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: LockMode.UPGRADE help on deleting entities in 2 TX
PostPosted: Fri Feb 09, 2007 7:08 am 
Newbie

Joined: Thu Jul 28, 2005 6:17 am
Posts: 14
Hibernate version:
3.2.1GA

Name and version of the database you are using:
Postgres 8.1.4

Hi,

We're having a problem using LockMode.UPGRADE. The situation is as follows:
We persist an Object with an id in a TX
Then we start 2 TX's in seperate Threads (to simulate parallel processing), in both TX's we first try to get the Object with LockMode.UPGRADE with the same id as above, remove this object and then insert it again. (The remove uses flush() and clear())

What we expect is that TX1 performs these actions and TX2 will be suspended untill TX1 is done. TX2 will then get the lock on the Object inserted during TX1 and then performs the same actions.

What we see is that TX2 is suspended during TX1 but TX2 cannot find the Object anymore based on the id after TX1 is done. This is not what we want but are unsure of what is exectly happening. For TX we use PROPAGATION_REQUIRES_NEW to make sure there are 2 seperate TX's. We've tried different isolationlevels but no luck.

Hope someone can point us in the right direction or has an anwser.

Thanks,
Maarten


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.