-->
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.  [ 4 posts ] 
Author Message
 Post subject: Optimistic concurrency
PostPosted: Sun Sep 11, 2005 12:03 pm 
Newbie

Joined: Fri Sep 02, 2005 4:00 pm
Posts: 7
Location: Poland
Hi

I'm using ejb3 (jboss 4.0.3 RC2) and I have problem with optimistic concurrency.

1) Application A update record in table with @Version column
2) Application B update the same record
3) Application A want to update the same record (after catch org.hibernate.StaleObjectStateException)

My question is: How to repleace record (with higher version number) by older record?


Maciek


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 11, 2005 12:12 pm 
Newbie

Joined: Fri Sep 02, 2005 4:00 pm
Posts: 7
Location: Poland
I forgot to say that I'm using EntityManager and remote client application. Stateful session bean (business logic) and PersistenceContextType.EXTENDED


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 13, 2005 6:56 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
open a new persistence context, load the object and copy the values in it (probably only some and with business logic for that).

_________________
Emmanuel


Top
 Profile  
 
 Post subject: Final solution ?
PostPosted: Tue Jun 13, 2006 12:06 pm 
Newbie

Joined: Tue Jun 13, 2006 11:53 am
Posts: 2
It's a bit of a pain to do that throughout the whole application... Is there a plan to enable retries in the same persistence context? Or maybe a better workaround ?


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