drop table and locks
Posted in 1992
Hi there list,
We have detected a problem when droping a table (temporary or not) or an
index in a database without transactions.
When someone drops a Table or an Index, the program leaves a lock on the table.
This is particulary serious when dropping a table, because the lock
remains on a table that no longer exists.
In this situation, if another user try to create a temporary table
(implicitly or explicitly), there is a high probability to be blocked
on that lock.
If you do a 'drop index' the corresponding lock can be cleared with an
'update', 'delete', 'insert' or 'select' statement.
You can check this with the following program (using 'tbstat -k' when
you get a prompt message):
re--------------------cut--------------------here--------------------cut--------
database db
main
define c char,
n integer
create table t ( a integer, b integer)
create index ixa on t ( a)
create index ixb on t ( b)
{ there's a lock in table 'systables' }
prompt "There is no lock in the table t" for char c
drop index ixa
prompt "There is a lock in the table" for char c
drop index ixb
prompt "The lock remains in the table" for char c
select count(*) into n from t
prompt "There is no lock in the table" for char c
drop table t
prompt "There is a lock in the dropped table" for char c
end main
--------here--------------------cut--------------------here--------------------c
Does anyone know if this is a known bug (before I formally submit it
to Informix)?
Is there any way to release the lock after dropping the table?
Any help is welcome.
Thanks in advance,
MM
-------------------------------------------------------------------------------
| Manuel Figueiredo Monteiro |
| S.S.F. - Servicos de Software Financeiro, Lda VOICE: +351 (1) 727-0303 |
| Estrada da Luz, No 104 - Loja A FAX: +351 (1) 727-0335 |
| 1600 Lisboa E-MAIL: mm@ssf.pt |
| PORTUGAL |
-------------------------------------------------------------------------------