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: Concurrency Control in Web Application
PostPosted: Mon Nov 20, 2006 8:00 am 
Newbie

Joined: Fri Oct 27, 2006 8:43 am
Posts: 14
Hi people,


I have a doubt on concurrency control for a web application:

Suppose i am updating an object with id X. I just opened a new form and i'm editing the data. The problem is that i'm too slow, and Mr. M also wants to update the same data as i. As he is much faster, he did everything and saved it while i was still editing the data.

Finally i try to save, but Mr. M had saved before and the database should give me an error message. If i use simple <version> property, it won't work, because when i get the object properties after the submit, Mr. M will have saved his data.

We thought here of passing the old version value as a hidden object. We can make the version check in our application, but this is not desirable. Is there way to check this automatically? We tried setting the version to an older value to check if hibernate would complain, but it doesn`t. Actually, it simply ignore our attempt to set the version value and it increments it as expected.

Any ideas on how to solve our problem? Thanks a lot!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 21, 2006 6:16 am 
Newbie

Joined: Fri Oct 27, 2006 8:43 am
Posts: 14
No ideas?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 21, 2006 6:31 am 
Regular
Regular

Joined: Tue May 16, 2006 3:32 am
Posts: 117
Quote:
the database should give me an error message


Hibernate would give an error for the case you mentioned if you are using optimistic locking i.e. <version> tag.

Quote:
If i use simple <version> property, it won't work, because when i get the object properties after the submit, Mr. M will have saved his data.



submit here refers to Mr M's submit?

If you are again reading the data, after Mr M has saved then obviously there would be no error since you are working on the latest data.

Not sure if I understood what your problem is..


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 13, 2006 8:49 am 
Beginner
Beginner

Joined: Fri Nov 18, 2005 5:49 am
Posts: 23
Even we are facing the same issue. If any one has the solution , please let us know ---

Seshadri , Bangalore


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.