Managing logical units of work

To start a logical unit of work, set the eci_extend_mode parameter to ECI_EXTENDED and the eci_luw_token parameter to zero, when making a program link call. The Client daemon generates a LUW identifier which is returned in the eci_luw_token field. This identifier must be input to all subsequent calls for the same unit of work. To call the last program in a LUW, set the eci_extend_mode parameter to ECI_NO_EXTEND. To end a LUW without linking to a program, set the eci_extend_mode parameter to ECI_COMMIT or ECI_BACKOUT to commit or back out changes to recoverable resources.

Table 1 shows how you can use combinations of eci_extend_mode, eci_program_name, and eci_luw_token parameter values to perform tasks associated with managing logical units of work through ECI. In each case you must also store appropriate values in other fields for the call type you have chosen.

Table 1. Logical units of work in ECI
Task to perform Parameters to use
Call a program that is to be the only program of a logical unit of work.

One request flows from client to server and a reply is sent to the client only after all the changes made by the specified program have been committed.

Set up the parameters as follows:
  • eci_extend_mode: ECI_NO_EXTEND
  • eci_program_name: provide it
  • eci_luw_token: zero
Call a program that is to start an extended logical unit of work. Set up the parameters as follows:
  • eci_extend_mode: ECI_EXTENDED
  • eci_program_name: provide it
  • eci_luw_token: zero

Afterwards, save the token from eci_luw_token.

Call a program that is to continue an existing logical unit of work. Set up the parameters as follows:
  • eci_extend_mode: ECI_EXTENDED
  • eci_program_name: provide it
  • eci_luw_token: provide it
Call a program that is to be the last program of an existing logical unit of work, and commit the changes. Set up the parameters as follows:
  • eci_extend_mode: ECI_NO_EXTEND
  • eci_program_name: provide it
  • eci_luw_token: provide it
End an existing logical unit of work, without calling another program, and commit changes to recoverable resources. Set up the parameters as follows:
  • eci_extend_mode: ECI_COMMIT
  • eci_program_name: null
  • eci_luw_token: provide it
End an existing logical unit of work, without calling another program, and back out changes to recoverable resources. Set up the parameters as follows:
  • eci_extend_mode: ECI_BACKOUT
  • eci_program_name: null
  • eci_luw_token: provide it

If an error occurs in one of the calls of an extended logical unit of work, you can use the eci_luw_token field to see if the changes made so far have been backed out, or are still pending. See the description of the eci_luw_token field in CICS Transaction Gateway: Programming Reference for more information. If the changes are still pending, end the logical unit of work with another program link call, either committing or backing out the changes.