Table locking status

hamzarh@sgp.hp.com (HELMY HAMZAR) writes:
: 
: I am looking for a way to find out the locking status of a particular
: table/records in a table from ingres 4gl; whether it is being locked
: exclusively or shared locking. I know that there is a timeout section
: in 4gl, but I don't need interactive session, as I am writing a batch
: program activated from the cron.
: 
: I know that this is a basic question, but I can seems to find a way to
: do so.

The only way I can think of to do this is to invoke 'lockstat' and
send the output to a file, then scan the output for the information
you want.  You'll get a page number and a lock state.  How you 
relate the page number to the row you are interested in escapes me
for the moment, because the only reliable way to get it will be
to retrieve the TID of the row, but the page will be locked, so you
may stall waiting for the TID.  Catch-22.

You can set a timeout to control how long your batch job will wait
for a lock.  That may be a better approach, but it requires that you
encounter the lock and incur the wait, rather than allowing you to 
predict that you will have to wait so you can avoid it.

I think you have probably taken a wrong turn somewhere.  What you are
asking for is something that I have never seen anyone need.  What
exactly are you trying to achieve?  There has to be a better way.

--Roy Hann





You are right, I have a better way of doing it. I can always use an intermediate
table to make program1 aware that program2 is running.

I am not sure if you have a better way. Any suggestion is highly appreciated.

Regards,
Helmy
Ingres Q & A
To William's Home Page

© William Yuan 2000

Email William