vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 |
| |||
| "Sumanth" <Sumanth.Yamala@sas.com> wrote in message news:e01ldj$d39$1@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. |
| ||||
| Mark A wrote: > "Sumanth" <Sumanth.Yamala@sas.com> wrote in message > news:e01ldj$d39$1@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 |