Hello all,
We have an ABF application with around 200 users.
When a user comes across a "duplicate key error" - due to some dodgey data,
they're not willing to press return to remove the message off the screen
until they speak to a techy.
At the moment it seems that the system escalates to a table level lock,
which then locks out the 200 users.
(I'm current reading the manual on locking)
So basically, can anyone point me at the right parameters... I thought that
the user would only lock the page or record they're currently on.
Cheers
Gareth
English:- This message is confidential. If you are not the intended
recipient of the message then please notify the sender immediately. Any of
the statements or comments made above should be regarded as personal and not
necessarily those of Bro Morgannwg NHS Trust, any constituent part or
connected body. Cymraeg:- Mae'r neges hon yn gyfrinachol. Os nad chi yw'r
derbynnydd y bwriedid y neges ar ei gyfer, byddwch mor garedig â rhoi gwybod
i'r anfonydd yn ddi-oed. Dylid ystyried unrhyw ddatganiadau neu sylwadau a
wneir uchod yn rhai personol, ac nid o angenrhaid yn rhai o eiddo
Ymddiriedolaeth GIG Bro Morgannwg, nac unrhyw ran gyfansoddol ohoni na
chorff cysylltiedig.
kbcomput@kbcomputer.com - 26 Nov 2003 14:53 GMT
> Hello all,
>
[quoted text clipped - 11 lines]
> So basically, can anyone point me at the right parameters... I thought
> that the user would only lock the page or record they're currently on.
What you want to do is add this to your ABF program:
SET SESSION WITH ON_ERROR = ROLLBACK TRANSACTION;
somewhere early on. You might have to use EXECUTE IMMEDIATE, I forget if
the set session statement ever made it into 4GL.
What that will do is tell Ingres to abort the transaction instead of the
statement when something like a dup key occurs. That way the ABF program
won't be holding locks while the user is looking at the black-bar message.
If the ABF code is set up to *depend* on statement level instead of
transaction level rollback (e.g. if it attempts inserts before updates,
say), then you are going to have to play some games with the IIseterr()
routine. The idea would be to suppress the Ingres FRS message, get back
to your ABF code which will check for errors (RIGHT???), rollback on
error, and only then output a message.
Karl