Home » Developer & Programmer » Forms » Forms locking (Forms 10g)
Forms locking [message #311043] Thu, 03 April 2008 05:16 Go to next message
srinivas.k2005
Messages: 334
Registered: August 2006
Senior Member
Hi,

I have a screen where two users works from differnt location on the same screen ,which updates the same database table.
So when one user opens the screen and updates some fields on the screen, which is a database item fields
and will not save the record.
At the same time another user opens the screen and he also updates some field at this
moment it locks.

But in my project it is like both the user opens the screen ,talk on phone and both should be allowed
to update the fields.

how can i do this?


Thanks,
Srinivas
Re: Forms locking [message #311194 is a reply to message #311043] Thu, 03 April 2008 12:18 Go to previous messageGo to next message
Littlefoot
Messages: 20891
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I don't get it ... they are talking on the phone. Why wouldn't only one of them do these changes? Where's the purpose in doing it simultaneously (even if it was possible)? One would modify my salary to 1000, and the other one to 100. Which one is correct? Who will you believe?

As I see it, the general idea is wrong. Oracle will not allow both of them update the same record. The first one will have to commit (or rollback) changes he/she had made in order to allow another one deal with same data.
Re: Forms locking [message #311314 is a reply to message #311194] Fri, 04 April 2008 01:18 Go to previous messageGo to next message
srinivas.k2005
Messages: 334
Registered: August 2006
Senior Member
Hi,

May be i have to still explain in detail.

Same screen they are operating and 2 users are on phone.
User 1 and user 2.
The record they are updating is an emp record ,of same emp_id.
But user 1 can update only salary field.
user 2 will update the address or any other changes.

both are doing the changes different fields but same record and different session and no one is giving commit.

Thanks,
Srinivas
Re: Forms locking [message #311317 is a reply to message #311314] Fri, 04 April 2008 01:32 Go to previous messageGo to next message
Littlefoot
Messages: 20891
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
As far as I can tell, no way. Two (or more) users can not modify the same record at the same time. The first one of them MUST either commit or rollback in order to allow the other one to modify columns he's supposed to.
Re: Forms locking [message #311395 is a reply to message #311043] Fri, 04 April 2008 06:37 Go to previous messageGo to next message
Kaeluan
Messages: 179
Registered: May 2005
Location: Montreal, Quebec
Senior Member
Only way i see to do that is basing your block on a procedure instead of table. The block will pass the record structure to the procedure and in the procedure you write your code to do the update. You also have to overwrite the on-lock trigger in the form.

This should work since form will no longer lock the table. The lock will be only when the update in the procedure will be executed. So except if the 2 user are comitting exactly at the same second it should work.

Hope it help.
Re: Forms locking [message #312038 is a reply to message #311395] Mon, 07 April 2008 20:07 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
You could have non-database block based items and use manual DML to do the updates making sure that you have a commit immediately after the update of the single field that is available for update. You should also test to make sure that the contents of the field still has the same value it had when it was retrieved before you do the update.

I don't like the concept of two people 'changing the same record' but it can be done.

David
Re: Forms locking [message #312277 is a reply to message #312038] Tue, 08 April 2008 06:43 Go to previous message
srinivas.k2005
Messages: 334
Registered: August 2006
Senior Member
Thanks for all your reply.
Previous Topic: Need Time stamp value
Next Topic: dynamically adding a row item in a data block
Goto Forum:
  


Current Time: Sun Dec 04 02:42:44 CST 2016

Total time taken to generate the page: 0.09755 seconds