user manual
Chapter 27: Using VisiConnect 317
Application Development Overview
container terminates a component instance, the container cleans up all the
connections used by that component instance.
Non-Managed Application Scenario
In the non-managed application scenario, a similar programming model must
be followed in the application component. The non-managed application must
lookup a connection factory instance, request to obtain an EIS connection, use
the connection for EIS interactions, and close the connection when completed.
The following steps are performed when a non-managed application
component requests to obtain a connection to an EIS instance from a
connection factory:
1 The application component calls the getConnection() method on the
javax.resource.cci.ConnectionFactory instance to get a connection to the
underlying EIS instance.
2 The connection factory instance delegates the connection request to to the
default connection manager instance. The Resource Adapter provides the
default connection manager implementation.
3 The connection manager instance creates a new physical connection to the
underlying EIS instance by calling the
ManagedConnectionFactory.createManagedConnection() method.
4 Invoking ManagedConnectionFactory.createManagedConnection() creates a new
physical connection to the underlying EIS, represented by the
ManagedConnection instance it returns. The ManagedConnectionFactory uses the
security information from the JAAS Subject object, and
ConnectionRequestInfo, and its configured set of properties (port number,
server name, etc.) to create the new ManagedConnection instance.
5 The connection manager instance calls the
ManagedConnection.getConnection() method to get an application-level
connection handle. This method call does not necessarily create a new
physical connection to the EIS instance; it produces a temporary handle
that is used by an application to access the underlying physical connection,
represented by the ManagedConnection instance.
6 The connection manager instance returns the connection handle to the
connection factory instance; the connection factory in turn returns the
connection to the requesting application component.
Code Excerpts - Programming to the CCI
The following code excerpts illustrate the application programming model
based on the CCI - requesting to obtain a connection, obtaining the
connection factory, creating the interaction and interaction spec, obtaining a
record factory and records, executing the interaction with the records, and
performing the same using result sets and custom records.
// Get a connection to an EIS instance after lookup of a connection factory
// instance from the JNDI namespace. In this case, the component allows the
// container to manage the EIS sign-on










