You can still get deadlock while inserting into a single table (at least with V7.x). DB2 is locking more than just the rows being inserted. It also has index locks that are probably causing your situation.
My suggestion would be to have very small UOWs so that the locks are not held for any length of time. This means that your developers need to commit more often if possible. If this is not possible, maybe they should explictly put a table lock before inserting rows
(LOCK TABLE mytable IN EXCLUSIVE MODE). THis will prevent anyone else from accessing (reading or writing) the table while the UOW is active.
Andy
Quote:
Originally posted by David2002
Thank you ARWinner, I should say
1- all three processes are trying to insert rows in ONE table, so you think even "small lock wait timeout" works?
2- I suggested to developers to create three temptables for inserting rows in them and then import from those temptable to original table. Is it work (from performance point of view) ?
thanks
|