Process Flow for Cross-Transaction Locks

Use

In this scenario we want to lock a token from system X in LUW A in system Y. This lock has to last until the end of LUW B in system Z. The lock therefore has to last longer than the technical transaction. The application requests a reference R in LUW A so that the reference counter of the CSL increases. Reference R is forwarded by the application to another LUW B in system Z and used there. After LUW B has been updated, the runtime environment releases reference R implicitly.

Prerequisites

  1. The CSL exists in system X.

  2. The CSL is activated in system Y for the lock object type that is assigned to the token.

  3. The CSL exists in system Z.

The function modules CSLEO_ADDREF and CSLEO_USEREF have no effect if these prerequisites are not met. Compare also the prerequisites for the CSLEO_ENQUEUE function module. See Process Flow for Cross-System Locks.

Process

  1. The application calls the CSLEO_ENQUEUE function module during the dialog of LUW A and receives the token. The application can now edit the objects that need to be protected exclusively.

  2. The application calls the CSLEO_ADDREF function module (usually after the protected objects have been processed) in the dialog or when LUW A is updated, and receives reference R. This means that the lock remains after the CSL has been updated.

  3. The application of LUW A transfers reference R in a message to an application in LUW B in system Z.

  4. The application in LUW B in System Z first has to call the CSLEO_USEREF function module and transfer reference R to the CSL. Lock requests in this LUW with the CSLEO_ENQUEUE call are now successful.

  5. When LUW B is updated, a call is dropped in system Y by using a transactional RFC in the PERFORM-ON-COMMIT routine of the CSL. The lock reference is released in this way.

The graphic below illustrates this process flow:

Cascading the Application Case

After the reference has been used in the dependent LUW B, it can be repeated in the same way. You can execute the CSLEO_ADDREF function module in LUW A as often as you want, and communicate the added R references in various dependent LUWs B. The LUWs therefore usually form a tree structure with the initial LUW A as its root.