Subject | Re: [IBO] [IB_SQL] How to use IB_SQL like SqlMonitor |
---|---|
Author | Paul Vinkenoog |
Post date | 2003-06-16T22:18:57Z |
Hi Stefano,
understanding is that if LockWait is true, the transaction just waits
until the lock has been removed (no matter how long it takes), and
then does whatever it has to do. So you'll only set LockWait to true
if you're pretty sure that any locks will be quickly removed (like in
the now famous example).
If an error is raised, I guess it can't be a lock error (unless
there's some built-in timeout).
If LockWait is false and there is a lock, am error will be raised
immediately. You can then have your code retry after some time... or
not... or ask the user...
limited time, the simplest thing seems setting LockWait to true.
Greetings,
Paul Vinkenoog
[ sorry if I'm breaking anybody's threading:
I'm replying to a forwarded message here, references are lost ]
> i have yet got the long -awaite deadlockAre you sure? I'm not talking from my own experience here, but my
> locking the record via IB_SQL and
> posting a new record from the test application
>
> Now i have a new one question :
>
> Setting LockWait = true the deadlock error is raised only when the
> lock condition is removed
understanding is that if LockWait is true, the transaction just waits
until the lock has been removed (no matter how long it takes), and
then does whatever it has to do. So you'll only set LockWait to true
if you're pretty sure that any locks will be quickly removed (like in
the now famous example).
If an error is raised, I guess it can't be a lock error (unless
there's some built-in timeout).
If LockWait is false and there is a lock, am error will be raised
immediately. You can then have your code retry after some time... or
not... or ask the user...
> is it correct to intercept the deadlock and handle itI suppose so, since the conflict will arise upon posting.
> in the TIB_Queery.OnPostError ?
> what's the best solution to intercept the deadlockIf - like in the example - you know that locks will only exist for a
> and try to post again ?
limited time, the simplest thing seems setting LockWait to true.
Greetings,
Paul Vinkenoog
[ sorry if I'm breaking anybody's threading:
I'm replying to a forwarded message here, references are lost ]