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 > Table Locks

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-03-07, 10:20
retierney retierney is offline
Registered User
 
Join Date: Sep 2007
Posts: 13
Table Locks

Hi and please excuse my ignorance...

Operating System: AIX 4.3.3.0
DB2: 7.1.0 02010105

I am trying to enhance the performance and concurrency of a legacy application that I support. The tables are very large. I have a complex query that joins six tables. The server connects to the database using isolation level "uncommitted read". When the server executes this query it returns the first 50 rows to the client and then waits for the client to request more or to cancel the request.

When I execute this query I notice that DB2 locks all six tables in IN mode and that the locks are NOT escalation locks. DB2 also acquires six row locks of type NS on SYSIBM.SYSTABLES. One row for each table.

The query is really read-only data so I added the FOR READ ONLY clause to the SELECT statement. This eliminated the six row locks on SYSIBM.SYSTABLES. This is good because I know these row locks could be a source of concurrency problems.

Questions:
1 - Is there any way to make the table locks go away?
2 - If the table locks remain, can another application update a row that is in the result set of the "active query"?

Please forgive the length of this post. Thank you very much...
Reply With Quote
  #2 (permalink)  
Old 10-04-07, 02:06
meehange meehange is offline
Registered User
 
Join Date: Jul 2004
Posts: 256
IN locks are Intent None locks, this means the lock holder can read any of the locked rows but not update them... all other concurrent applications can read or update these rows

In short you don't have a locking problem.
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