| Author |
locking and unlocking mechanism
|
Joseph Tsui
Greenhorn
Joined: Jan 05, 2002
Posts: 6
|
|
Hi All,
I am trying to implement a client program that can obtain record from MSSQL. I am using hibernate to do that.
So client A and client B will get record from DB server
both client A and B are on different machines
How can i prevent the situation that
ClientA get
ClientB get
ClientA update
ClientB update
In the database, i have a retrieve flag for each record. once the client get the record, it will update the record with the retrieve flag = true
Anyone can provide me advice on that? thanks a million
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
Have a google (or a search in these forums) for "optimistic locking" - this is techique usually used to solve the lost update problem. Also, have a read of the Hibernate documentation about versioning, which is Hibernate's optimistic locking implementation.
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
 |
|
|
subject: locking and unlocking mechanism
|
|
|