-->
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: Managing Mutiple Transaction with Hibernate
PostPosted: Wed Jul 09, 2008 9:37 am 
Newbie

Joined: Wed Jul 09, 2008 9:25 am
Posts: 1
Location: Tampa,Florida
I need to develop a process which involves a database table with 'n' number of records with 'm' number of user accessing the table.
Like for example Table contain records like Data1, Data2,Data3....,DataN
Users are User1, User2, ....UserN.

Now at some time User2 is trying to modify Data2 and at the same time User5 is deleting Data2.

So how can we handle such a situation via Hibernate? How can we maintain a lock on the table so that only one user can access a table when concurrent transaction is done?
And if we place this lock, how this lock can be flushed out after one transaction is complete?

My application is proposed to be on Java and Spring ?And I need a suggest a design for the same? Can anyone suggest anything?[b]

_________________
-Vishal


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 09, 2008 5:05 pm 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
This is a standard, classical transaction management scenario. If you set your locking and transaction levels appropriately, you can alleviate any problems.

Just remember that Hibernate reads and writes data within the scope of a transaction. If the data is locked by one user, it won't be available until that user has completed their transaction. Then, another user may use the unlocked data.

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


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.