Re: Mystery lock being applied
Posted in 1997
Dave Voelker wrote:
>
> We have jsut released a PowerBuilder application which user Informix
> 7.01 as the back-end and I have noticed that occassionally, rather
> infrequently, a table-level lock will get applied by the application.
> When we connect our isolation level is set to Committed Read and we also
> issue a SET LOCK MODE WAIT 10 immediately after connection. Nowhere in
> the application do we alter this locking strategy in code.
>
> I am wondering what can cause a table-level lock to get applied given
> the previous instructions. If I knew the potential situations under
> which this could possibly occur it would go a long way to helping us
> identify when and where this happens.
Table level locks occurr whenever you
+ create / drop / alter a table - eXclusive
+ enter: LOCK TABLE IN Share/eXlusive MODE
+ unload your table using "onunload" or "onpload (express mode)"
( X locks )
The special "Intent" locks occurr always:
+ whenever you lock a row or page - locks like "IS, IX" ( oh, I forgot
what happens during an Update Lock, I think it was "SIX" or s.th.
like that.
Because you are using "COMMITTED READ" - a level that does not really
set Shared Locks, you will rarely see "IS" or "S" locks. Because you
are wondering about locks, here's just an additional info:
COMMITTED READ uses BUFFERED CURSORS and whenever your application
is fetching a row, this will be read from your cursor buffer. Since
the cursor of the server is running ahead, you might read dirty data.
But in the past, the data was committed.
PS: Any comments, did I forget something ?
Bye
Stefan