Use the Interaction interface to link to a server program. The ECI resource
adapter provides an implementation of the Interaction interface but you should
not use this directly. You should use the ECIInteractionSpec class directly,
to define the properties of the interaction:
- Set the FunctionName property to the name of the CICS® server program.
Set the InteractionVerb to SYNC_SEND for an asynchronous call
or SYNC_SEND_RECEIVE for a synchronous call. Use SYNC_RECEIVE to retrieve
a reply from a asynchronous call. Note: - When a SYNC_SEND call has been issued with the execute() method of a particular
ECIInteraction object, that instance of ECIInteraction cannot execute another
SYNC_SEND, or SYNC_SEND_RECEIVE, until a SYNC_RECEIVE has been executed.
- Simultaneous asynchronous calls to the same connection are permitted,
provided this does not result in two asynchronous calls being outstanding
within the same transaction scope. If this happens an exception is thrown.
- If you are using the adapter in local mode with IBM® WebSphere® Application Server for z/OS®, and you
require transactional support, specify the SYNC_SEND_RECEIVE interaction type.
If you use SYNC_SEND and SYNC_RECEIVE to issue asynchronous requests, the
ECI requests will be issued with sync on return, and will be outside the scope
of the current global transaction. In remote mode, asynchronous calls work
normally.

- If you are using
channels and containers, the program receiving the data does not need to know
the exact size of the data returned. If you are using COMMAREAs, set the CommareaLength property to the length
of the COMMAREA being passed to CICS. If this is not supplied a default
is used:
- SYNC_SEND, SYNC_SEND_RECEIVE
- Length of input record data
- SYNC_RECEIVE
- The value of ReplyLength
- Set the ReplyLength property to the
length of the data stream to be returned from the Gateway daemon to
the JCA application. This can reduce the data transmitted over the network
if the data returned by CICS
is less than the full COMMAREA size, and you know the size of the data in
advance.
The JCA application still receives a full COMMAREA of the size
specified in CommareaLength, only the amount of data sent over the network
is reduced. This method is equivalent to the setCommareaInboundLength() method
available for the ECIRequest class.
If you do not set ReplyLength,
the CICS Transaction Gateway automatically
strips trailing zeros from the COMMAREA sent from the Gateway daemon to
the JCA application, without needing to know the size of the data in advance.
For
more information on COMMAREA stripping, see Performance considerations when transmitting data in a COMMAREA.
As with ECIConnectionSpec, you can set properties on the ECIInteractionSpec
class at either construction time or by using setters. Unlike ECIConnectionSpec,
the ECIInteractionSpec class has been designed as a Java™ bean.
So in a managed environment, your server may provide tools to allow you to
define these properties using a GUI without writing any code.
- To specify a value for ECI timeout, set the ExecuteTimeout property of
the ECIInteractionSpec class to the ECI Timeout value. Allowable values are:
- 0
- No timeout. This is the default value.
- A positive integer
- Time in milliseconds.
If you are using a CICS Transaction Gateway on z/OS, you cannot specify
a value for ECI timeout. As an alternative, you can set the TIMEOUT parameter
in the EXCI options table DFHXCOPT. For more information see the CICS External
Interfaces Guide.
See Timeout of the ECI request for more information on ECI timeouts.