I hope someone can help I have two or more threads which are inserting into the same target database table, each having their own connection. The connection has autoCommit set to false and I am performing batch inserts (batch size 10) and am only commiting once all inserts have been performed per thread.
My problem is that I am getting a deadlock, which I can't understand because I am only inserting into the one table.
if yes then you can add synchonized keyword to you method. [ October 28, 2004: Message edited by: Shailesh Chandra ]
Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
Scott William Sinclair
Joined: Oct 12, 2004
Thanks for the response, there is no common method for inserting.
I managed to change the server locking schema to "datarows" instead of "allpages", so it is row based instead of table based and that seems to have fixed it. I'm just confused how a deadlock could ocurr in the first place, since normally a deadlock requires two resources to be in contention.