The locks are at the database level. Almost all the lock I see is of object
type Row and is an X lock
There are around 4 users updating table A at around the same time, the data
set is mutually exclusive so
using DB2_EVALUNCOMMITTED
Have already modified the locklist and maxlocks parameter ...
The reason I want to have a better control on the number of locks is to
prevent any lock escalations which
could lead to deadlocks.
My basis is on the fact that each update would not require more than 10,000
locks and so have set maxlocks
and locklist accordingly..(the update updates only 8192 rows or lesser)
but I still see deadlocks. And in the deadlocks logs I see close to 50,000
locks for the update statement.
Not sure how to get a handle on the locks to prevent escalation.
Thanks,
Sumanth
"Ian" <ia*****@mobileaudio.com> wrote in message
news:44**********@newsfeed.slurp.net...
Sumanth wrote: Hi,
We have the following scenario:
1) update table A by joining with a global temporary table B
2) There is a one to one correspondence between A and B as the pk's of
both tables are the same
3) The max number of rows in B is 8192
My questions:
1) When an update is done with db2_evaluncommitted set to YES then the
max number of locks attained should be equivalent to 8192
right? if not why?
I am seeing locks in the order of 50000 - 100,000 and not sure why I
see that after setting db2_evaluncommitted to YES.
DB2_EVALUNCOMMITTED has nothing to do with the number of locks that an
application will take when performing updates. It controls whether DB2
can "read through" locks held by other connections (i.e. uncommitted
transactions) to determine if the locked rows will match before trying
to take out the row lock.
As far as the number of locks you see, is this at the application level,
or at the database level? Have you also accounted for other locks
caused by the update (index keys, etc)?
2) Also does db2_evaluncommitted property hold good for global temporary
table?
DB2_EVALUNCOMMITTED doesn't make sense on GTTs, because only 1
connection can see the table, therefore there are no locking issues.
3) Any other property that I can tune/change to reduce the number of
locks?
Reduce LOCKLIST or MAXLOCKS; use 'LOCK TABLE' statement prior to update;
or ALTER TABLE LOCKSIZE TABLE.