table locking problems
Posted in 1999
Hi, I have a problem where my Java applic. needs to read some tables periodically. It needs to lock the tables for some time and after processing, it has unlock them. It only reads tables. and doesn't update them, so I lock them in share mode. Applic. locks the tables one by one (15 tables) as: lock table <table> in share mode; First it complained that could not lock tables without transaction. So now what I do is start a transaction (i.e. begin work) and when done with tables, I commit transaction which I believe releases all locks, so I don't have to specifically unlock the tables. And this is done in every interval. Q1: Is this the right way ? Q2: The tables are locked periodically and interval is 1 min. But after I start the applic., I can't update the table or change the schema from an isql window if I want to and I get error 242 and error 106 even during the interval when tables are unlocked. Can somebody point out what am I missing ? Thanks -AH