By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,924 Members | 1,651 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,924 IT Pros & Developers. It's quick & easy.

deadlock related

P: n/a
Hi ,

I am trying to acquire a lock on a table A in exclusive mode, and this
statement gives an error indicating a deadlock or timeout
has been detected. The lock timeout value is set to 0 which I understand
is to wait for however long it takes to acquire a lock.

Also there are other processes that have acquired row level exclusive
locks on the table A when this error happened.Is DB2
throwing this error as a pre-emptive measure.

I was expecting that the lock table A in exclusive mode statement would
be a blocking call. Any thoughts?

Thanks,
Sumanth

Logs:
lock table Schema.A in exclusive mode ;
ERROR: CLI execute error: [IBM][CLI Driver][DB2/NT] SQL0911N The current
transaction has been rolled back because of a deadlock or timeout. Reason
code "2". SQLSTATE=40001

Mar 24 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Sumanth" <Su************@sas.com> wrote in message
news:e0**********@foggy.unx.sas.com...
Hi ,

I am trying to acquire a lock on a table A in exclusive mode, and this
statement gives an error indicating a deadlock or timeout
has been detected. The lock timeout value is set to 0 which I
understand is to wait for however long it takes to acquire a lock.

Also there are other processes that have acquired row level exclusive
locks on the table A when this error happened.Is DB2
throwing this error as a pre-emptive measure.

I was expecting that the lock table A in exclusive mode statement would
be a blocking call. Any thoughts?

Thanks,
Sumanth

Logs:
lock table Schema.A in exclusive mode ;
ERROR: CLI execute error: [IBM][CLI Driver][DB2/NT] SQL0911N The current
transaction has been rolled back because of a deadlock or timeout. Reason
code "2". SQLSTATE=40001


Reason code 2 indicates that it is a deadlock, and not a locktimeout (which
is reason code 68). So the error is because DB2 has detected a deadlock (by
default, the deadlock detector fires every 10 seconds to see if any
deadlocks exist, and if so it will cancel one of the applications).

If you cannot figure out the problem, then I would suggest setting up an
event monitor for deadlocks. With V8.2 and requesting detail reports you can
see the actual SQL statements involved in the deadlock. See the Command
Reference.
Mar 25 '06 #2

P: n/a
Mark A wrote:
"Sumanth" <Su************@sas.com> wrote in message
news:e0**********@foggy.unx.sas.com...
Hi ,

I am trying to acquire a lock on a table A in exclusive mode, and this
statement gives an error indicating a deadlock or timeout
has been detected. The lock timeout value is set to 0 which I
understand is to wait for however long it takes to acquire a lock.

Also there are other processes that have acquired row level exclusive
locks on the table A when this error happened.Is DB2
throwing this error as a pre-emptive measure.

I was expecting that the lock table A in exclusive mode statement would
be a blocking call. Any thoughts?

Thanks,
Sumanth

Logs:
lock table Schema.A in exclusive mode ;
ERROR: CLI execute error: [IBM][CLI Driver][DB2/NT] SQL0911N The current
transaction has been rolled back because of a deadlock or timeout. Reason
code "2". SQLSTATE=40001


Reason code 2 indicates that it is a deadlock, and not a locktimeout (which
is reason code 68). So the error is because DB2 has detected a deadlock (by
default, the deadlock detector fires every 10 seconds to see if any
deadlocks exist, and if so it will cancel one of the applications).

If you cannot figure out the problem, then I would suggest setting up an
event monitor for deadlocks. With V8.2 and requesting detail reports you can
see the actual SQL statements involved in the deadlock. See the Command
Reference


If I am not mistaken, in V8.x the deadlock event monitor is created and
activated by default, unless otherwise disabled or dropped. It should
already be there. Use the GUI in the Control Centre to view the information.

Bob
Mar 26 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.