Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

My application has 4 different threads doing inserts into the same DB2 table simultaneously.

Could this cause a deadlock / lockwait situtation?

Theoretically I don't see a problem here; as one insert statement is not going to lock a row required by another insert statement because all are independent insert statements.

Also, I commit after each insert so transaction log wouldn't fill up.

I'm looking for a high performance model while avoiding any potential lock situtation. Please provide your thoughts.

share|improve this question
    
Is this at all related to your other question? dba.stackexchange.com/questions/47652/… –  Chris Aldrich Aug 7 '13 at 19:22
add comment

1 Answer

I don't see a problem either.

If your application logic allows, you might consider committing every N rows.

For improved performance, you might consider whether you can do blocked inserts of multiple rows at a time.

(I use DB2 for i. If you are on LUW or z/OS, your mileage may vary.)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.