Re: ONLINE 5.03 Locking Question
Posted in 1995
On Aug 11, 10:11am, aiii@iac.net wrote: > Subject: Re: ONLINE 5.03 Locking Question > Jim, > > There is only one application running against the database in question. > > I also read up on shared buffer locks in the OnLine Admin guide but this still > doesn't explain why lockes are being placed on the table. When I do a tbstat -k > I'm seeing row-level locks where I expect them to be, but there are also several > table-locks (denoted by a rowid of 0). I'm fairly certain that this is not the > result of some heinous Informix bug, rather my ignorance as to the workings of > the locking mechanism. Just as with row level shared locks which indicate that a process is using a row so that other processes don't interfere, Informix takes a shared lock on the table to indicate to other processes that the table is in use so that other processes have a simple way of finding out whether a table is in use. The manual doesn't say this specifically but it allows Informix to use a locking design in which a "lock table" statement can check for a single table lock before taking exclusive lock on a table instead of checking for row locks on the table. I cannot prove this, as I don't know the details of how locks are represented in shared memory, but I expect that the row locks, in the row lock shared memory structure, are not obviously distinguished by table, unless you know the row lock you are looking for. It was therefore quicker to create table locks and check them than scan the row locks, checking each one to see which table it is attached too, to see if a lock exists on a table. Cheers - Jim -- ----------------------------------------------------------------------------- Jim Gordon DHL Airways Inc. jgordon@us.dhl.com ----------------------------------------------------------------------------- My opinions are my own. They may vary with time but they remain mine!