I keep running into "enq: TX - row lock contention", when I run the Sql command below in a oracle 9 DB. The table mytable is a small table, with less than 300 lines.
UPDATE MYTABLE
SET col1 = col1 + :B3 ,
col2 = SYSDATE
WHERE :B2 = col3
AND :B1 = col4
I run 10 threads at the same time, and some wait as long as 10 seconds to get a chance to update. I know I will face this deadlock issues, but the problem for me is that they should be able to be much faster, since the table is small, so updating it would be fast.
edit:I cannot alter this code, it is inside a third party application. I can only tweak the DB.
what can I do to improve the speed of the rowlock queue? How can I improve this waiting time so my threads run faster?