delete on table which has simultaneous inserts

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
just4u_sharath
Premium Member
Premium Member
Posts: 236
Joined: Sun Apr 01, 2007 7:41 am
Location: Michigan

delete on table which has simultaneous inserts

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply