Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Locking the table

Status
Not open for further replies.

venkat2003

Programmer
Feb 11, 2003
8
IN
Hi,

Please clarify this doubt.

Let us assume that there are two tasks. First task is locking the table and doing some process. At the same time second task is looking for same table which is locked by the first task. Please let me know what are the sqlcodes and abends i may get and how to overcome this problem. Please let us know the solution for this.

Thanks
Venkat
 
Venkat,
The sqlcode you returned when a user has a table locked is -911. Locking is quite a large subject which can be affected by the level of locking (row, page, table) whether the lock has escalated from it's original lock status, what locking type options have been specified in the BIND parameters etc. etc.

I suggest that you have a read up on locks in order to be able to ascertain what you require. The link is fairly comprehensive, although I'm sure there are better ones out there.

Hope this helps a little
Marc
 
IF your happy to do a "dirty read" on one of your tables then you can use WITH UR on your read and binds etc.

Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top