-->
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.  [ 2 posts ] 
Author Message
 Post subject: concurrency and hibernate
PostPosted: Sun Oct 24, 2004 6:42 am 
Newbie

Joined: Sun Oct 24, 2004 6:37 am
Posts: 2
We are trying to explore possibilities of following:

1. user1 loads an object from db, changes some properties on it and after validations tries to save it. Meanwhile user2 logs in and deletes that item even before user1 sent an update(). How would hibernate trap the deletion and let user1 know that no object exists ?

2. user1 loads object from db, changes properties, tries saving it. Meanwhile user2 concurrently does same and is successful in saving the state of object before user1. Before user1 actually calls save() can the concurrent update be known? In other words user1 now has stale data that he is updating. Can he know that it is stale and be alerted ?

3. How and what do we need to achieve locking on rows so that concurrent edit/update wouldn't even be possible and user2 would be alerted right away when he tries any edit/delete/update ?

4. Does hibernate caching play a role in above scenarios ? How does hibernate know that db state of certain object changed ? Do we have to write extra code checking properties or would hibernate do it for us ?

I need specific information on how to configure such scenarios. Any sample code/snippets that you can provide would be very helpful.

Thanks in advance,

Sameer


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 24, 2004 6:44 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
start reading optimistic lock with versionning
you can also check concurrency chapter in hibernate in action.

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


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