Home » Developer & Programmer » Forms » Prevent concurrent users from accessing records in form by locking (6i)
Prevent concurrent users from accessing records in form by locking [message #310188] Mon, 31 March 2008 09:12 Go to next message
parag_narkhede
Messages: 110
Registered: January 2008
Location: Pune
Senior Member
Hello,
I have requirement, in which i want to lock a record if one user has queried it, so that another user cannot query it again.

How to do this?
Re: Prevent concurrent users from accessing records in form by locking [message #310305 is a reply to message #310188] Mon, 31 March 2008 20:27 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Create a 'user_parms' table, in it have columns that match the key fields of your main table. When the user selects a record for update, place its key into this field and then commit it. In the form restrict the query so that any keys in the 'user_parms' table are not retrieved. Remember to clear the item when the user has finished with it. You will also need to create a 'manager' screen which is able to 'clear' this field in case the application has crashed while a record was being updated.

David
Re: Prevent concurrent users from accessing records in form by locking [message #310325 is a reply to message #310188] Mon, 31 March 2008 23:40 Go to previous messageGo to next message
azamkhan
Messages: 557
Registered: August 2005
Senior Member
Issue following select statement

SELECT * FROM your_table
WHERE your_condition
FOR UPDATE;


This for update will lock your desired record. And will drop the lock if you issue COMMIT or FULL_ROLLBACK.
Re: Prevent concurrent users from accessing records in form by locking [message #310327 is a reply to message #310188] Mon, 31 March 2008 23:44 Go to previous messageGo to next message
parag_narkhede
Messages: 110
Registered: January 2008
Location: Pune
Senior Member
Thanks a lot. But i am not able to understand what exactly approach you are following, I mean how shall i proceed.
Let me repeat my requierment again.

"I have developed a custom form.Now i want to handle concurrent users, so that two users shoudnt be able to query same records simultaneously. In oracle handle update and delete, wherein it lock the records updating by a user. but how to do this query purpose."


Re: Prevent concurrent users from accessing records in form by locking [message #310330 is a reply to message #310327] Mon, 31 March 2008 23:48 Go to previous message
azamkhan
Messages: 557
Registered: August 2005
Senior Member
Dear Friend if you are trying to stop concurrent user to access the same record then why dont you stop them on logon.

if you want to do it any way then I think that Mr. David is right.
Previous Topic: Check the fmx file whether exists or not?
Next Topic: 'srw.do_sql' must be declared
Goto Forum:
  


Current Time: Sun Dec 08 07:26:30 CST 2024