If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > deadlock or timeout

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-17-08, 12:17
rajaryan4545 rajaryan4545 is offline
Registered User
 
Join Date: Nov 2007
Posts: 27
deadlock or timeout

Hi
i want to use 'WITH UR' option in a select query.
actually the query is causing a deadlock or timeout.
the following error is coming
SQL0913N Unsuccessful execution caused by deadlock or timeout. Reason code
"". SQLSTATE=57033

is this the correct way of using WITH UR

select c, d from mno , uvw where mno.a=uvw.b
WITH UR;

the db is db2V8.1 fp 14 solaris
any help would be appreciated.
Reply With Quote
  #2 (permalink)  
Old 01-17-08, 15:36
smith43017 smith43017 is offline
Registered User
 
Join Date: Sep 2006
Posts: 92
Dead lock mean two applications(SQL) are trying to use same information (tables or rows). You got find out why other SQL or application holding that long. Yes you can use with ur (UNCOMMITED READ) for select stament.
Reply With Quote
  #3 (permalink)  
Old 01-17-08, 17:11
sundaram sundaram is offline
Registered User
 
Join Date: Mar 2006
Posts: 104
try

Select .... FOR READ ONLY WITH UR

Regards

Harikumar
Reply With Quote
  #4 (permalink)  
Old 01-18-08, 04:10
azs0309 azs0309 is offline
Registered User
 
Join Date: Jan 2008
Posts: 88
set the following registry variables

DB2_EVALUNCOMMITTED=YES
DB2_SKIPINSERTED=YES

that should help. u can search for these if u want more info
Reply With Quote
  #5 (permalink)  
Old 01-18-08, 04:11
azs0309 azs0309 is offline
Registered User
 
Join Date: Jan 2008
Posts: 88
but please post ur LOCKLIST, MAXLOCKS and LOCKTIMEOUT parameter and keep taking some snapshots to know what actually happening
Reply With Quote
  #6 (permalink)  
Old 09-09-08, 14:26
msspurlock msspurlock is offline
Registered User
 
Join Date: Dec 2006
Posts: 5
Have you converted your indexes to Type II?

And were your files schema-bound after running the fix pack?
Reply With Quote
  #7 (permalink)  
Old 09-17-08, 07:06
Shubhrojyoti Shubhrojyoti is offline
Registered User
 
Join Date: Sep 2008
Posts: 6
Hi,

This may help:
db2 " ? SQL0913N"


SQL0913N Unsuccessful execution caused by deadlock or timeout.
Reason code "<reason-code>".

Explanation:

The request issued was involved in an unresolved contention for
use of an object and the execution failed.

The reason codes are as follows:


2 transaction branch failed due to deadlock.

68 transaction branch failed due to lock timeout.

72 transaction rolled back due to an error concerning a DB2 Data
Links Manager involved in the transaction.

80 statement failed due to timeout.



User Response:



o For reason code 80, you can retry the failed statement
without terminating the application. If the application
accesses multiple remote databases, it may be better to
rollback the transaction to avoid the possibility of a global
deadlock.

o For other reason codes, issue a request to rollback the
transaction. The transaction cannot be committed due to the
failure of the current transaction branch.

o To help avoid deadlock or lock timeout, issue frequent COMMIT
operations, if possible, within long-running applications or
applications requiring data with high concurrent access.



sqlcode : -913

sqlstate : 57033
Reply With Quote
  #8 (permalink)  
Old 09-17-08, 14:01
msspurlock msspurlock is offline
Registered User
 
Join Date: Dec 2006
Posts: 5
Quote:
Originally Posted by rajaryan4545
Hi
i want to use 'WITH UR' option in a select query.
actually the query is causing a deadlock or timeout.
the following error is coming
SQL0913N Unsuccessful execution caused by deadlock or timeout. Reason code
"". SQLSTATE=57033

is this the correct way of using WITH UR

select c, d from mno , uvw where mno.a=uvw.b
WITH UR;

the db is db2V8.1 fp 14 solaris
any help would be appreciated.
When you try:
SELECT c,d
FROM mno , uvw
WHERE mno.a = uvw.b
WITH UR;

and add "FETCH FIRST 1
ROW ONLY"

does it work?
Reply With Quote
  #9 (permalink)  
Old 09-19-08, 06:18
Shubhrojyoti Shubhrojyoti is offline
Registered User
 
Join Date: Sep 2008
Posts: 6
Smile Need to add one "s"

add "FETCH FIRST 1 ROWS ONLY"
Reply With Quote
  #10 (permalink)  
Old 09-19-08, 10:32
HanbingL HanbingL is offline
Registered User
 
Join Date: Dec 2007
Posts: 15
select .... FETCH FIRST n ROWS ONLY FOR READ ONLY WITH UR
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On