Joined: 13 Feb 2009 Posts: 20 Location: United States of america
I have a mainframe job which updates the DB2 table. Sometimes users runs query againgst this DB2 table and mainframe job will wait for locks and finally abends due to time out error. Then we ask DBA to purge the user's session and i will restart job.
Is it possible that before mainframe job starts, i can put some check if any user is using table and purge the particular session.
You dont say what is being used for the query. Some of the options in, say SPUFI, can be quite restrictive in a "sharing" environment - even when the query has completed!
UR will give relief of "dirty reads" are acceptable
Problem with checking first is what happens if something sneaks in between the check and the job ?
If it a critical updater consider LOCKing the table ... but may cause more problems than it solves!
Better ask your DBA abt using UR.......Deadlock problem can be solved or reduced by scheduling the jobs in much organised way.....
We had a similar problem sometime back and we used partitioned table.....so that till todays date data get inserted......last updated date data remains active in one partition and after completion of insertion of data in next partition last date data becomes inactive and new one as active......but this all depends upon architecture of your application