467,185 Members | 1,230 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,185 developers. It's quick & easy.

LOCKTIMEOUT

we use db2 udb v8.1 on windows, our application use jdbc to create
connection and sql statement, we will need the row lock prevent other
session update but allow to read at the same time for the same row.
since the row lock holding could be couple minutes, so for the
LOCKTIMEOUT , should i change to a normal range which will allow to
wait for the lock release ? is there any problem for that? thanks
Nov 12 '05 #1
  • viewed: 2595
Share:
1 Reply
<db********@yahoo.com> wrote in message
news:11*************************@posting.google.co m...
we use db2 udb v8.1 on windows, our application use jdbc to create
connection and sql statement, we will need the row lock prevent other
session update but allow to read at the same time for the same row.
since the row lock holding could be couple minutes, so for the
LOCKTIMEOUT , should i change to a normal range which will allow to
wait for the lock release ? is there any problem for that? thanks


If you use "select .... for update", then DB2 should take an SIX lock (share
with intent to update). This will allow others to take S (share or read
only) locks, but will prevent other SIX or X (update) locks from occurring.
Then your program can do the update, which will cause the SIX to escalate to
X lock (still at the row level). Make sure you use CS isolation level and
commit as soon as the update is completed to release the locks (or as soon
as possible).

If this does not work, you could try to use UR isolation level (you can code
this directly in the select statements) on your selects.
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by George McLean | last post: by
11 posts views Thread by EoRaptor | last post: by
9 posts views Thread by Jane | last post: by
11 posts views Thread by ChetWest | last post: by
8 posts views Thread by Mark A | last post: by
2 posts views Thread by Justin | last post: by
3 posts views Thread by Racerx | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.