Locking to win last update ? [message #656001] |
Mon, 19 September 2016 13:07 |
|
bluetooth420
Messages: 146 Registered: November 2011
|
Senior Member |
|
|
Hi,
My problem is as follow:
In two different oracle forms sessions working on same table(s).
Session #1 reads the row "Joe Bloggs".
Session #2 reads the row "Joe Bloggs".
Session #2 changes the row to "Jane Bloggs" and saves.
now, Session #1 is still looking at "Joe Bloggs" on their screen.
Session #1 changes the row to "Joe Jones" and saves.
But the updation of session #1 is lost.
I want "last update wins".
Tried to study execute_query(for_update) but it stops session 2 and even does not allow session 3 in my multi user/session environment.
Kindly guide.
Just an additional point: Session 2 is using
FORMS_DDL(update table set column='Jane Bloggs');
FORMS_DDL('COMMIT');
while session 1 is using data entry form in execute_query mode.
|
|
|
|
Re: Locking to win last update ? [message #656013 is a reply to message #656004] |
Tue, 20 September 2016 03:30 |
cookiemonster
Messages: 13925 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Last update always wins unless it errors out.
By default forms will lock a row in the DB as soon as you start editing it in the datablock.
And as LF says if you try to save changes to a row that's been updated by someone else you'll get a forms error.
Have you got an on-error trigger that's masking errors?
|
|
|
Re: Locking to win last update ? [message #656015 is a reply to message #656013] |
Tue, 20 September 2016 05:54 |
|
bluetooth420
Messages: 146 Registered: November 2011
|
Senior Member |
|
|
On-error trigger has not raised/caught any error.
I have solved the problem other way.
Before execute_query in session 1, i riased a flag on the record on which i was about to work.
Due to raised flag, session 2 was NOT looking this record as i have added FLAG='N' in where clause. So session 2 was not looking the record.
LAter, at end of working in session 1, after committing form, i raised the flag down. Now session 2 module can see the record.
Flag system was not there when i posted my problem but anyhow i managed to solve it as i can bear to ignore FLAGGED records in session 2.
Thanks LF and CM for your time. I really appreciate it
|
|
|