Hi,
I'd like to understand the behaviour of transactions and locks via AppServer through a simple example.
Client-side : a program which calls a procedure on a Server (RUN ON SERVER) in a transaction bloc (DO TRANSACTION).
Server-side : the procedure called, just performing a FIND with EXCLUSIVE-LOCK.
When the procedure returns to the calling one on the client-side, the transaction is no longer active, even if i'm still in my transaction bloc (checking this with PROMON using a PAUSE statement just after the RUN myproc.p statement), and the record accessed has SHARED status, not EXCLUSIVE (PROMON / Record locking table).
Another consideration : how does the client get alerted that the record he tries to access is not already being accessed by someone else (deadlocks) as in a typical client / server configuration ? As the advertisement is on the server-side, how is it passed back to the client ?
Do i have to use automatic transaction to figure it out ?
Hope for a little help on this, any information would be greatly appreciated,
Kub.
I'd like to understand the behaviour of transactions and locks via AppServer through a simple example.
Client-side : a program which calls a procedure on a Server (RUN ON SERVER) in a transaction bloc (DO TRANSACTION).
Code:
DO TRANSACTION ON ERROR UNDO, LEAVE
ON ENDKEY UNDO, LEAVE
ON STOP UNDO, LEAVE:
RUN myproc.p PERSISTENT SET hProc ON SERVER hServer.
END.
Server-side : the procedure called, just performing a FIND with EXCLUSIVE-LOCK.
When the procedure returns to the calling one on the client-side, the transaction is no longer active, even if i'm still in my transaction bloc (checking this with PROMON using a PAUSE statement just after the RUN myproc.p statement), and the record accessed has SHARED status, not EXCLUSIVE (PROMON / Record locking table).
Another consideration : how does the client get alerted that the record he tries to access is not already being accessed by someone else (deadlocks) as in a typical client / server configuration ? As the advertisement is on the server-side, how is it passed back to the client ?
Do i have to use automatic transaction to figure it out ?
Hope for a little help on this, any information would be greatly appreciated,
Kub.