Skip to Content
0
Former Member
Jun 17, 2010 at 10:25 AM

Deadlock when delete rows with blob.

116 Views

Hello

I have the following issue. I try to clean a table that contains a BLOB column.

To do this I use SQLDBC I create a statement that contains the LOB column, I fetch the line, load the Blob. and before fetching the next line, I send a delete request. and I fall in the deadlock.

If I fetch the next line before sending the delete request there is no deadlock, there is also no deadlock if i do not request le LOB column in the select.

In fact when I made select with LOB, there is the follwing line in DOMAIN.LOCKS

SESSION;TRANSCOUNT;PROCESS;USERNAME;DATE;TIME;TERMID;LASTWRITE;LOCKMODE;LOCKSTATE;APPLPROCESS;APPLNODE;SCHEMANAME;OWNER;TABLENAME;TABLEID;ROWIDLENGTH;ROWIDHEX;ROWID;

295513; 4290;438;ESKDBADM;2010-06-17;12:05:46;ly-delorme-u..1674;?;tab_share;?;5748;LY-DELORME.esker.corp;?;?;?;0000800000046919;0;?;?

when i send the delete request the following lock appears in DOMAIN.LOCKS. A exclusif lock on the column I want to delete. It's ok

SESSION;TRANSCOUNT;PROCESS;USERNAME;DATE;TIME;TERMID;LASTWRITE;LOCKMODE;LOCKSTATE;APPLPROCESS;APPLNODE;SCHEMANAME;OWNER;TABLENAME;TABLEID;ROWIDLENGTH;ROWIDHEX;ROWID;

295521; 4287;167;ESKDBADM;2010-06-17;12:05:49;ly-delorme-u..1674; 5;row_exclusive;write;5748;LY-DELORME.esker.corp;ESKDBADM;ESKDBADM;DBM350_AUTOTESTXML;0000000000000934;5;00C51133800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;

BUT there is a dead lock , I think because of the following entry in DOMAIN.LOCK_WAITS

TABLENAME;TABLEID;H_TERMID;H_PROCESS;H_APPLPROCESS;H_APPLNODE;H_ROWIDHEX;H_ROWID;H_LOCKMODE;H_DATE;H_TIME;H_LOCKTIMEOUT;R_TERMID;R_PROCESS;R_APPLPROCESS;R_APPLNODE;R_ROWIDHEX;R_ROWID;R_REQMODE;R_DATE;R_TIME;R_REQTIMEOUT;

?;0000800000046919;ly-delorme-u..1674;438;5748;LY-DELORME.esker.corp;?;?;tab_share;2010-06-17;12:05:46;?;ly-delorme-u..1674;167;5748;LY-DELORME.esker.corp;?;?;tab_exclusive;2010-06-17;12:05:49; 3585

The database request a tab_exclusive lock on tableid 0000800000046918 but there is already a tab_share lock on this.

Do you why there is a lock on the table : tableid 0000800000046918 ?

How to avoid this lock using SQLDBC ?

Thanks for you help.

Yann.