Subject Re: [IBO] LockWait seems does not work
Author Stefano Campri
> Hi again Stefano!
> >*********************************************************
> >In one instance, start to enter a new header, but don't post it.
> >
> >Do the same in the second instance but, this time, try to post it.
> >Observe that you get a Deadlock message.
> >This is not a problem - it shows that the lock applied in the Before
> >trigger by the first instance is working.
> >*********************************************************
> Here you should get a deadlock error, since you haven't handled the

i should get .... but it doesn't happend : that's the meaning of my post
someone can help me ?!?!?

> >*********************************************************
> >Making use of Planned Deadlocks :
> >When the transaction goes to post the new record, it first runs through
> >Before Insert triggers and comes to the one in position 9. There, it
> >to see if any log rows exist containing recycled invoice numbers. If so,
> >"grabs" the lowest number and performs a dummy update - SET
> >This causes InterBase to lock the set of available rows. Because each
> >user's transaction also has LockWait set to true, this causes the
> >condition for all other contenders for the lowest number. LockWait tells
> >the database engine that, if a lock is encountered, the transaction wants
> >wait until the conflict goes away.
> >*********************************************************
> Here you shouldn't get any error, since you've told IBO to wait (other
> transactions are in a deadlock condition since the conflict hasn't been
> resolved, but through LockWait you've explicitly told IBO to wait rather
> than to report an error).

But if i set LockWait = false i should get an error

That's the problem :
Setting LockWait = false no error are raised

The problem is the LockWait or the the Before Insert trigger
with the dummy update SET STATUS = STATUS ?!?!

Stefano Campri