Subject | Re: [IBO] LockWait seems does not work |
---|---|
Author | Stefano Campri |
Post date | 2003-06-11T15:18:56Z |
> Hi again Stefano!Insert
>
> >*********************************************************
> >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.deadlock.
> >*********************************************************
>
> 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 ?!?!?
>its
> >*********************************************************
> >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, itlooks
> >to see if any log rows exist containing recycled invoice numbers. If so,it
> >"grabs" the lowest number and performs a dummy update - SETSTATUS=STATUS.
> >This causes InterBase to lock the set of available rows. Because eachDeadlock
> >user's transaction also has LockWait set to true, this causes the
> >condition for all other contenders for the lowest number. LockWait tellsto
> >the database engine that, if a lock is encountered, the transaction wants
> >wait until the conflict goes away.But if i set LockWait = false i should get an error
> >*********************************************************
>
> 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).
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