By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,287 Members | 1,284 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,287 IT Pros & Developers. It's quick & easy.

LOCKTIMEOUT

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
<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.