-->
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.  [ 3 posts ] 
Author Message
 Post subject: Pessimistic locking with long session
PostPosted: Wed Apr 27, 2005 3:22 pm 
Beginner
Beginner

Joined: Mon Jun 21, 2004 2:41 pm
Posts: 40
I am trying to design out our application and our database architecture but I am having some problems finding the correct solution to our problem.

In the Hibernate in Action book on page 172, first paragraph, it says that you may "implement a simple long pessimistic lock yourself, using Hibernate to manage the lock table. Patters for this can be found on the Hibernate website". I cannot find this on the website. Or am I looking at the wrong thing?

Our problem, we are creating an ERP web enabled product that will use EJBs to perform the business logic. Since there are also other process that can perform business logic that can take long periods of time then we have the problem of a user trying to modify information on a page and then a long term running process hits a spot where it is also manupilating the data.
We therefore are unable to use optomistic locking in our application.

What we need to do is start the user in a READ mode. When the user selects the button to put the screen in EDIT mode then we need to lock the record(s) that they see. The lock is eventually release when they either exit EDIT mode or press the save or delete buttons.

My reading shows that the pessimistic lock that hibernate creates is only kept for the transaction.

Suggestions?

Thank you,
David W.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 02, 2005 11:17 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Hasn't been written, but you are welcome to give it a try. Implement Martin Fowlers "Pessimistic offline lock" - beware, as always he stops describing the pattern when it gets interesting (ie. it doesn't support read/write mode, only exclusive read or write).


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 02, 2005 11:18 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Also note that this stuff is equivalent to nailing one foot to the floor.


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