Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Could not reserve record (2). Keep trying ?....

324137Aug 24 2005 — edited Jul 17 2006
This has to be a classic Oracle forms problem.

I would like to replace that useless message by a more user friendly message when a user tries to update a record which is already locked by another user. I found the following solution in here using the on-lock trigger:

Declare
is_locked boolean := false;
dummy VARCHAR2(2);
Begin
Begin
Select null INTO dummy from mytable
where rowid = :myblock.rowid
for update nowait;
exception when Others then
If sqlcode = -00054 Then
is_locked := True;
End If;
end;
IF is_locked then
Showmessage('Another user is updating this record. Try again later.');
raise form_trigger_failure;
End if;
End;

However, when I add that code, it seems to change the behavior of the locking process. For instance, If the record is locked by user A, user B gets the expected "Another user is updating..." as long as the record lock is active.

When the user A commit the changes, user B is then able to change the data when he should have get the "Record has been updated by another user. Please re-query" message. Therefore, user A loses it's changes when user B does a commit.

Any ideas why or any suggestions ?

Thanks.

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Aug 14 2006
Added on Aug 24 2005
22 comments
36,235 views