Procedural Access


The Java 2 Connector Architecture provides a means for integrating EIS backends with a J2EE application server to provide synchronous access. Building a Connector is beyond the scope of this book, but WSAD Integration Edition provides wizards and examples that show how to build one. The following sections discuss issues in using connectors and WebSphere's support for them.

Connectors and Connection Management

The Java 2 Connector Architecture (http://java.sun.com/j2ee/download.html#connectorspec) introduced a new programming pattern that allows a component to cache a handle for a connector for the lifetime of a component. This cached handle pattern is an alternative to the get/use/close pattern, where a client obtains a handle, uses it, and then closes the handle before returning. It may be tempting to use a cached-handle programming pattern as a performance boost. Don't be fooled by this. The run time code path necessary to do handle re-association on every method invocation can be quite substantial. The recommended pattern is get/use/close.

It's important to note that connections are always used within a containment boundary. If a global transaction is not in place, a local transaction is used. At the completion of the containment boundary, the connection will either be committed or rolled back based on configuration policies.

From a client API usage point of view, Connectors are very similar to JDBC resources. Resources are defined in the deployment descriptor and retrieved using JNDI. The difference between JNDI and Java 2 Connectors is that Connectors can use either a Common Connector Interface (CCI) or a Connector-specific client interface.

Connectors are packaged in Resource Archive (RAR) files. These RAR files can be packaged within an application's EAR file for application specific access or they can be installed on a server for access by multiple applications. Also, the RAR files contain declarations of required Java 2 Security permissions that must be granted. These permissions are merged with the system granted permissions at runtime. The WAS allows permissions to be filtered out so that permissions that should not be automatically granted during an application installation will not be granted.

The WAS–IE provides connectors for CICS, IMS, and Host-On-Demand (HOD). These specialized Connectors can be used to drive Container Managed Persistence (CMP) access to a Connector.

There are some issues to be aware of with the Java 2 Connector Architecture. IBM is actively pursuing resolutions to these within the specification groups and will be providing proprietary workarounds in the meantime:

  • Although the Java 2 Connector 1.0 and J2EE 1.3 specifications state that an application should not use shareable connections in an unsharable manner, there is no real way for an application server to police programming mistakes. For example, changing the isolation level of a shared connection would probably cause other uses of the connection to fail. This can potentially lead to lost update and deadlock problems that are very difficult to diagnose. Until the specification is updated to provide a mechanism for application servers to police shared connections, it is recommended that connection properties should not be changed for sharable connections.

  • There are situations where the application server cannot communicate connection event problems back to the connector. This prevents the connector from cleaning up its internal state and notifying the application. WAS provides a proprietary interface that connectors may implement to be notified of problems (until the spec. is cleaned up).

  • Thread safety of the connector can cause unanticipated exceptions in the programming model. The specification allows for a single active connection handle strategy to be used to implement a thread safe resource adapter. However, this strategy can cause problems with programming model patterns that cache connection handles. Therefore, caching connection handles is not recommended. In addition, it is best to understand the thread safety of the connector being used to make sure it is not used in an unsafe manner.

  • There are XA recovery issues when a Java 2 Connector RAR file is packaged within a J2EE application. It is recommended that RAR files be packaged outside of the EAR until this is resolved.

Resource Adapters

Resource Adapters can be built by IBM tools to provide access to back end systems, and driven by CMP entity EJBs that are mapped to them. The Adapters are typically composed from a constructed micro flow, but may be simple pass through wrappers to other things such as JDBC connections. The micro flow describes how to navigate EIS back end transaction flows and can be built using WSAD-IE.

JMS messaging, Connectors, and Resource Adapters all deal with moving data between an application and some other entity. The distinction between them is starting to blur as asynchronous functionality is moved into the Connector 1.5 specification and interoperability requires standardized messages or data structures. This is where Service Oriented Architectures start to appear.




Professional IBM WebSphere 5. 0 Applicationa Server
Professional IBM WebSphere 5. 0 Applicationa Server
ISBN: N/A
EAN: N/A
Year: 2001
Pages: 135

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net