406 Patterns: Implementing Self-Service in an SOA Environment
manages the clean up of unused connections. When terminating a component
instance, the container cleans up all connections used by that component
instance.
12.3.4 Executing the enterprise application
An interaction (Example 12-10) enables an application program to execute
functions provided by the enterprise tier. The execute method takes an input
record, output record, and an InteractionSpec. This method executes the
enterprise tier function represented by the InteractionSpec and updates the
output record.
An
Interaction instance is created from a Connection and is required to maintain
its association with the Connection instance. The close method releases all
resources maintained by the resource adapter for the interaction. Closing an
Interaction instance should not close the associated connection instance.
Example 12-10 Interaction
// use connection to create an interaction object
Interaction interaction = conn.createInteraction()
In Example 12-11, the code creates the InteractionSpec that executes the
interaction on a CICS ECI resource adapter.
Example 12-11 IneractionSpec
// Create and setup the CICS ECI interation spec
InteractionSpec iSpec = interactionSpec;
While creating the Java methods in the J2C Java BeanImpl bean, Rational
Software Architect allows you to set properties in InteractionSpec. In the
ITSOMart scenario, we are using an asynchronous ECI call and set the
FunctionName as MARTACCT. See Example 12-12,
Example 12-12 Create record and execute
if (iSpec == null)
{
iSpec = new com.ibm.connector2.cics.ECIInteractionSpec();
((com.ibm.connector2.cics.ECIInteractionSpec)iSpec).setFunctionName("MARTACCT")
;
}
...
//Create Record

Get Patterns: Implementing Self-Service in an SOA Environment now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.