Meaningless Drivel is fun!*
The moose likes BEA/Weblogic and the fly likes locking of database record Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "locking of database record" Watch "locking of database record" New topic
Author

locking of database record

k doshi
Ranch Hand

Joined: Mar 16, 2002
Posts: 41
i have a requirement whereby , when one person is working on a record, i.e when it displayed on his screen others should not be able to view it.
will this work if i use EJB transaction as serializable.
also if this works then, in case someone doesn't close that record, is there any time out in weblogic for the transaction
thanks for the reply
kiran
Rahul Mahindrakar
Ranch Hand

Joined: Jul 28, 2000
Posts: 1844
Do you want a single server architecture or a multi server architecture for this.
Rahul Mahindrakar
Ranch Hand

Joined: Jul 28, 2000
Posts: 1844
I think from the database level there is no way one can stop viewing data even if the isolation level is serializable.
So we need to design a solution at the application level and not at the database level.
k doshi
Ranch Hand

Joined: Mar 16, 2002
Posts: 41
this is a single server architecture.
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
You can set the transaction isolation level to Serializable by adding the following to your weblogic-ejb-jar.xml:
Rahul Mahindrakar
Ranch Hand

Joined: Jul 28, 2000
Posts: 1844
I do not think that setting the isolation will give us the required feature. The feature asked is to know that someone else is viewing the record and not to show it to any other till the viewing is closed.
Making the isolation level serializable will lock the record for a write but not for a read
k doshi
Ranch Hand

Joined: Mar 16, 2002
Posts: 41
ok sorry there is a clarification that while one is working on the record others should not be able to update it, so i think it may work
thanks
kiran
 
wood burning stoves
 
subject: locking of database record
 
Similar Threads
Locking Oracle Record
Two transactions in one CMP MDB
MDB does not rollback
Not able to Fetch Latest Records from Table
MDB does not rollback