Re: Table Locks in OnLine 7.x
Posted in 1998
Mark Goldin wrote:
> Does anyone know under which query circumstances OnLine will lock a table?
> The manual makes a brief mention of this but provides no examples. I
> suspect that aggregate queries may place some kind of table lock. If this
> is true, does it depend on isolation levels? Is there some other way to
> avoid locking the entire table? This would be similar to lock escalation in
> SQL Server which CAN be circumvented.
>
> Mark
Off the top of my head the only times Online would put either an S (share) lock
or X (exclusive) lock on a table would be these:
1) running oncheck -cD or -cI against a table
2) building an index against a table
3) onunloading a table
4) alter table (not in using the in-place algorythm)
The 1 other case I can think of is if you had your isolation level set to
repeatable read and you kicked off a query that had to do a sequential
scan of the table, I think we put a S lock on the table instead of individual
S locks on all the rows of the table.
I'm probably missing some other operations, but it sounds like you might
be hitting the S lock from using repeatable read?
Jacques
--
********************************************************************
* Jacques P. Renaut "I'd dazzle you with brilliance *
* Informix Advanced Support if I only had the knack..." *
* email: jrenaut@informix.com #include <disclamier.h> *
********************************************************************