Table locks and dead locks

Table locks and dead locks

Post by Alan Boldoc » Sat, 09 Jun 2001 11:28:59



I have a web app that creates and deletes products from a DB26.1 (fp8)
Database.

My problem is that when deleteing lots of products I get Deadlocks caused by
the delete
and other threads accessing the Table simultaneously.

Can someone explain why this is happening, what exactly is a deadlock and a
table/row lock.
Also why doesn't the lock clear? shouldn't one thread finish and free up the
table?

Also is there a setting I'm missing or is my schema inherantly flawed!

Thanks, I know Java but DB2 is a little bit of a black art.

--
Alan Boldock
Software Engineer
Bold Enterprise Pty Ltd

p:      08 8362 3623
f:       08 8362 3623
m:     0413 547 187

w:      http://www.boldenterprise.com.au

This email is confidential to the addressee. It may also be privileged. If
you are not the intended recipient any use, distribution, disclosure or
copying of this email is strictly prohibited. Neither the confidentiality
nor any privilege attaching to it is waived, lost or destroyed by reason
that it has been mistakenly transmitted to a person or entity other than the
addressee. If you have received this email in error, please delete it and
notify us immediately by telephone or email.

 
 
 

Table locks and dead locks

Post by Kim Bundgaar » Sat, 09 Jun 2001 16:49:08


Hi Alan Boldock

Your "delete-application" should issue COMMIT to release the row-lock.

When your application issue the DELETE, DB2 will hold a lock on the row
until your application finish (CONNECT RESET), issue an "end transaction"
with COMMIT or issue a rollback transactin with ROLLBACK.

--
Kim Bundgaard



> I have a web app that creates and deletes products from a DB26.1 (fp8)
> Database.

> My problem is that when deleteing lots of products I get Deadlocks caused
by
> the delete
> and other threads accessing the Table simultaneously.

> Can someone explain why this is happening, what exactly is a deadlock and
a
> table/row lock.
> Also why doesn't the lock clear? shouldn't one thread finish and free up
the
> table?

> Also is there a setting I'm missing or is my schema inherantly flawed!

> Thanks, I know Java but DB2 is a little bit of a black art.

> --
> Alan Boldock
> Software Engineer
> Bold Enterprise Pty Ltd

> p:      08 8362 3623
> f:       08 8362 3623
> m:     0413 547 187

> w:      http://www.boldenterprise.com.au

> This email is confidential to the addressee. It may also be privileged. If
> you are not the intended recipient any use, distribution, disclosure or
> copying of this email is strictly prohibited. Neither the confidentiality
> nor any privilege attaching to it is waived, lost or destroyed by reason
> that it has been mistakenly transmitted to a person or entity other than
the
> addressee. If you have received this email in error, please delete it and
> notify us immediately by telephone or email.