Page 1 of 1

delete on table which has simultaneous inserts

Posted: Sun Mar 22, 2015 1:12 pm
by just4u_sharath
Hello,
I am creating a job that deletes records from a table X. I am using DB2 connector stage. There is another process that inserts data in to Table X.
Will my delete statement lock the table. I am using all the default settings in connector stage. If both inserts and delete happen simultaneously will it lock the table?

Thanks

Posted: Sun Mar 22, 2015 3:30 pm
by ray.wurlod
Inserts and deletes should not be a problem if you are using row-level locking, since you can't delete a non-existent record and you can't insert an existing record.

If, however, you are using page or table level locking, then you may encounter lock contention.

Posted: Mon Mar 23, 2015 7:22 am
by chulett
I don't see anywhere that the DB2 Connector let's you control the level of locking used - however you can lock the entire table should you so desire. Plus I see a 'Lock with force' property for how to deal with any other applications that hold conflicting locks.

In your shoes I'd have a chat with your friendly neighborhood DBA man regarding row or page level locking and how that all works in DB2.