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 with SQLCAMESSAGE

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-13-04, 02:11
Romeo Romeo is offline
Registered User
 
Join Date: Feb 2002
Location: Philippines
Posts: 41
Question Deadlock with SQLCAMESSAGE

i never thought i would post a problem here... but a member of my DB2 user group had this problem that i couldn't figure out.... maybe someone else encountered this problem.... here goes:


OS: Red Hat Linux 8
DB: DB2 UDB ESE 8 (fixpak 7)

Here are some info on DB2:
Instance uses "32" bits and DB2 code release "SQL08020" with level identifier "03010106"
"DB2 v8.1.0.64", "s040812", "MI00086", and FixPak "7"

Product Name = "DB2 Enterprise Server Edition"
Product Identifier = "DB2ESE"
Version Information = "8.2"
Expiry Date = "Permanent"
Registered Connect User Policy = "Enabled"
Number Of Entitled Connect Users = "5"
Enforcement Policy = "Soft Stop"
Number of processors = "4"
Number of licensed processors = "128"
Database partitioning feature = "Not entitled"

Application:
a JAVA application running and executing multiple threads.

(... and here is the) PROBLEM:
Deadlock (lock-wait) with:
1. a thread executing CREATE TABLE, and
2. a thread executing:
call SYSIBM.SQLCAMESSAGE(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?, ?)


i've check the monitors and all other UOW are waiting for the LOCK-WAIT between the two applications. i could specify a value in the LOCKTIMEOUT parameter, but that would cause the JAVA app to end abnormally and rollback everything.

my questions are (besides solving this problem ) :
1. what does SYSIBM.SQLCAMESSAGE do? (i know it's a stored procedure)
2. i suspect authority issues in executing SYSIBM.SQLCAMESSAGE. do one need special authority in executing this stored procedure?
3. how was that stored procedure executed anyway? it is not encoded the in application
4. where can i get the documentation on SYSIBM.SQLCAMESSAGE?
5. do you guys have a redbook (pdf) on "DB2 Application Programming Guide and Reference for Java"?
__________________
There are 10 kinds of people,
those who know binary and those who don't.

http://www.linkedin.com/in/rtitong
Reply With Quote
  #2 (permalink)  
Old 09-13-04, 03:52
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
DB2 Universal JDBC driver uses a number of stored procedures with schema SYSIBM to retrieve catalog information, tracing and error message formatting ... (SQLCAMESSAGE seems to be error message formatting stored procedure ) ...

Though I have not seen any specific information, if you would like to restrict catalog access then you should also consider doing the same for these procedures ... Otherwise, granting to PUBLIC will be fine
HTH

Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 09-13-04, 03:54
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #4 (permalink)  
Old 09-13-04, 04:03
Romeo Romeo is offline
Registered User
 
Join Date: Feb 2002
Location: Philippines
Posts: 41
Quote:
Originally Posted by sathyaram_s

i've got this redbook already... so they have changed the name
__________________
There are 10 kinds of people,
those who know binary and those who don't.

http://www.linkedin.com/in/rtitong
Reply With Quote
  #5 (permalink)  
Old 09-13-04, 04:13
Romeo Romeo is offline
Registered User
 
Join Date: Feb 2002
Location: Philippines
Posts: 41
Quote:
Originally Posted by sathyaram_s
DB2 Universal JDBC driver uses a number of stored procedures with schema SYSIBM to retrieve catalog information, tracing and error message formatting ... (SQLCAMESSAGE seems to be error message formatting stored procedure ) ...
just my thoughts exactly... i assumed that the DB2 was trying so send out an error message... but why would it cause deadlock?

prior to the CREATE TABLE and SQLCAMESSAGE dead lock, there were CREATE TABLE statements... and those were successful table creations

Quote:
Originally Posted by sathyaram_s
Though I have not seen any specific information, if you would like to restrict catalog access then you should also consider doing the same for these procedures ... Otherwise, granting to PUBLIC will be fine
HTH

Sathyaram
i just check it... public already has execute access


i wish i could provide more details, but i am not familiar with JAVA... my analysis was based on the snapshots of the whole database
__________________
There are 10 kinds of people,
those who know binary and those who don't.

http://www.linkedin.com/in/rtitong
Reply With Quote
  #6 (permalink)  
Old 09-13-04, 04:22
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
I'm not very sure what would have caused the deadlock, but I guess your snapshot or a event monitor (a deadlock event monitor is created by default) should tell you the locks held that may give you some fairly good idea ..

HTH

Sahyaram
Quote:
just my thoughts exactly... i assumed that the DB2 was trying so send out an error message... but why would it cause deadlock?

prior to the CREATE TABLE and SQLCAMESSAGE dead lock, there were CREATE TABLE statements... and those were successful table creations
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #7 (permalink)  
Old 09-13-04, 05:26
Romeo Romeo is offline
Registered User
 
Join Date: Feb 2002
Location: Philippines
Posts: 41
Quote:
Originally Posted by sathyaram_s
I'm not very sure what would have caused the deadlock, but I guess your snapshot or a event monitor (a deadlock event monitor is created by default) should tell you the locks held that may give you some fairly good idea ..

HTH

Sahyaram
From the snapshot of locks:

Application handle = 23
Application status = Lock-wait

ID of agent holding lock = 21
Lock object type = Table
Lock mode = Intention Share Lock (IS)
Lock mode held = Intention Exclusive Lock (IX)
Lock mode requested = Exclusive Lock (X)
Name of tablespace holding lock = SYSCATSPACE
Schema of table holding lock = SYSIBM
Name of table holding lock = SYSTABLES

Application handle = 21
Application status = UOW Waiting


from the snapshot of applications:

Application handle = 23
Application status = Lock-wait
Dynamic SQL statement text:
CREATE TABLE ...

ID of agent holding lock = 21
Lock object type = Table
Lock mode = Intention Share Lock (IS)
Lock mode held = Intention Exclusive Lock (IX)
Lock mode requested = Exclusive Lock (X)
Name of tablespace holding lock = SYSCATSPACE
Schema of table holding lock = SYSIBM
Name of table holding lock = SYSTABLES
Lock is a result of escalation = YES


Application handle = 21
Application status = UOW Waiting
Dynamic SQL statement text:
call SYSIBM.SQLCAMESSAGE(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?, ?)


can you make anything out of it? like i said, previous CREATE TABLE statements were successful

i tried to suppress some info as this is running in the production server
__________________
There are 10 kinds of people,
those who know binary and those who don't.

http://www.linkedin.com/in/rtitong
Reply With Quote
  #8 (permalink)  
Old 09-13-04, 06:11
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
I guess it may be something that has taken place in the UOW (not yet committed) in application 21 that is be causing the problem ...

What did the lock snapshot say ?

Cheers
Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.

Last edited by sathyaram_s; 09-13-04 at 06:14.
Reply With Quote
  #9 (permalink)  
Old 09-13-04, 06:39
Romeo Romeo is offline
Registered User
 
Join Date: Feb 2002
Location: Philippines
Posts: 41
Quote:
Originally Posted by sathyaram_s
I guess it may be something that has taken place in the UOW (not yet committed) in application 21 that is be causing the problem ...

What did the lock snapshot say ?

Cheers
Sathyaram
it is the SQLCAMESSAGE that is causing the locks.... the stored procedure is just hogging the system tables!!!

... now i wanted to learn more about the stored procedure to identify what is causing this
Attached Files
File Type: txt locks.txt (8.2 KB, 90 views)
__________________
There are 10 kinds of people,
those who know binary and those who don't.

http://www.linkedin.com/in/rtitong
Reply With Quote
  #10 (permalink)  
Old 09-13-04, 09:32
sundialsvcs sundialsvcs is offline
Registered User
 
Join Date: Oct 2003
Posts: 706
SQLCA is simply the "SQL Communications Area" which is used to talk to a task. In this context it is a red herring. The bottom line is: "there is a deadlock; period." The question is why.

What kind of transaction-behavior is the Java application requesting? Can you log the entire, actual command sequence it is presenting to the SQL server?
__________________
ChimneySweep(R): fast, automatic
table repair at a click of the
mouse! http://www.sundialservices.com
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