accessing oracle and non- oracle data sources from j2ee applications: introducing jca lars ewe...
TRANSCRIPT
Accessing Oracle and Non-Oracle Data Sources from J2EE Applications: Introducing JCA
Lars EweProduct Manager
Oracle Corporation
Session id: 40045
Itamar AnkorionProduct Manager
Attunity
Agenda
J2EE Connector Architecture (JCA)
Oracle Application Server and JCA
Customer Case Study – Lloyds
The future of JCA
Oracle Application Server 10g Integration
Q&A
J2EE Connector Architecture – Introduction
JDBC – a history of database integration
First – we built our own databases– Proprietary concepts, rocket-science
Then came along commercial databases – Some common concepts, difficult to integrate
Then SQL (ODBC, JDBC) came along – Standard access to any database
Today – database access is a non-issue– My kid brother can do it…
JCA – the future of application integration First – Application Integration hurt
– Dissimilar technology, data, messaging...
Then came along XML– Standard, exchangeable data structure– Still need to know each disparate system
Then JCA came along– Standard access to any application
Starting today – application integration is becoming a non-issue
What is the benefit of JCA? The connector architecture reduces the
integration effort from an (m * n) problem to an (m + n) problem, where ‘m’ is the number of application servers and ‘n’ the number of EISs to be integrated
EIS EISAppServer AppServer
m*n m+n
JCA
J2EE Connector ArchitectureKey Components J2EE Application Server (AS)
– Container for resource adapter(s)
Enterprise Information System (EIS) Resource Adapter (RA)
– Connects EIS resource to the JCA infrastructure
Common Client Interface (CCI)– Provides a common programming interface model
for interacting with EIS via resource adapters
Quality of Service (QoS) Facilities– Connection & transaction management and security
J2EE Connector Architecture
OC4J - J2EE Application
Server
J2EE Application Component
Container-ComponentContract
Resource Adapter
Enterprise Information System
Client API (e.g. CCI)
System Contracts
EIS specific contracts
Connection Manager
Transaction Manager
Security Manager
Oracle Application Server 10g and JCA
J2EE 1.3 APIsJ2EE 1.3 APIs OC4J SupportOC4J Support
Oracle Application Server 10g (9.0.4) Containers for J2EE
JSP 1.2JSP 1.2Servlet 2.3Servlet 2.3EJB 2.0EJB 2.0
JDBC 2.0 ExtensionJDBC 2.0 Extension
JMS 1.0JMS 1.0
JNDI 1.2JNDI 1.2
Connector Architecture 1.0
JTA 1.0JTA 1.0
Java Mail 1.2Java Mail 1.2
JAXP 1.1JAXP 1.1
JAAS 1.0JAAS 1.0
JSP 1.2JSP 1.2Servlet 2.3Servlet 2.3EJB 2.0EJB 2.0
JDBC 2.0 ExtensionJDBC 2.0 Extension
JMS 1.0JMS 1.0
JNDI 1.2JNDI 1.2
Connector Architecture 1.0
JTA 1.0JTA 1.0
Java Mail 1.2Java Mail 1.2
JAXP 1.1JAXP 1.1
JAAS 1.0JAAS 1.0
Oracle Application Server
AJP13
ORMI
Web Client
EJB Client
Oracle HTTP Server
ORMI
AJPHTTP
OC4J Server Process
Web Container
EJB Container
JNDI
JMS
JDBC
JTA
JAXP
JAAS
…
JCA
mod_oc4j
Oracle Application Server 10g (9.0.4) JCA – Quality of Service (QoS)
Oracle’s JCA container implementationprovides additional QoS
Connection Pooling
Container Managed Sign-On (CMSO)– Declarative CMSO
– Programmatic CMSO
Connection Pooling
Specify minimum number of connections to create at startup
Limit the size of the connection pool by setting the maximum number of connections
Choose between fixed, fixed_wait and dynamic schemes for handling overflow of connection requests
Pick a timeout for fixed wait scheme
Connection Pooling Example<connection-pooling>
<description>
Pool with a minimum of one connection and a
maximum of three, when all three connections
are in use, a request for connection should
wait 60 seconds for a connection to free up,
else receive an exception
</description>
<property name="minConnections" value="1" />
<property name="maxConnections" value="3" />
<property name="scheme" value="fixed_wait" />
<property name="waitTimeout" value="60" />
</connection-pooling>
Container Managed Sign-On (CMSO) Configure container to take care of sign-on
to EIS transparently
Choose between different schemes– Declarative
– Programmatic
CMSO Overview
Declarative CMSO Example<connector-factory name="..." location="..."> ... <security-config> <principal-mapping-entries> <default-mapping> <res-user>guest</res-user> <res-password>guestpw</res-password> </default-mapping> <principal-mapping-entry> <initiating-user>scott</initiating-user> <res-user>scott</res-user> <res-password>tiger</res-password> </principal-mapping-entry> </principal-mapping-entries> </security-config> ...</connector-factory>
Programmatic CMSO Provide custom authentication module
Plug-in JAAS modules or implement OC4J-specific interfaces
JAAS modules are portable as compared to the OC4J-specific alternative
Authentication modules that implement OC4J-specific interfaces are simpler to write and deploy compared to JAAS modules
Customer Case Study
Oracle Application Server integration with back-end Mainframe CICS
The Players
The Lloyds Insurance Market (Lloyds) International Underwriters Association (IUA) Xchanging Ins-Sure Services (XIS)
Steria System Integration Oracle OC4J Attunity CICS JCA Adapter
Claim Convergence Project
Business Goals: Reduce TCO (operating and maintenance
costs) by converging two CICS based Claim systems
Increase end-user productivity with web interfaces
Establish agile IT foundation to quickly introduce new capabilities in the future
Solution Architecture
OS390
Oracle Application Server(Solaris)
WebBrowsers
FixNATFirewall
JSP
CICS
JCA
?
The Technical Objectives(i.e., Challenges)
Standard integration of J2EE and CICS (JCA, XML)– Develop productivity (known skill sets and tools)
– Isolate legacy from the Java developers
Turn legacy into reusable services (SOA)– Agile, reusable architecture foundation
– Save on maintenance
Robust, Simple mainframe connectivity– Native data type mapping (into XML)
– No changes to CICS applications
– No coding per transactions
CICS LogIn Program COMMAREA
01 C002-COMMAREA.03 C002-TRANS-ID PIC X(4)03 C002-SESSION-NO PIC S9(9) COMP.03 C002-PROG-STATUS PIC S9(4) COMP.03 C002-ERROR-COUNT PIC S9(4) COMP.03 C002-ERROR-TABLE OCCURS 10.
06 C002-ERROR-CODE PIC X(4).06 C002-ERROR-TEXT PIC X(70).
03 C002-WARNING-COUNT PIC S9(4) COMP.03 C002-WARNING-TABLE OCCURS 10.
06 C002-WARNING-CODE PIC X(4).06 C002-WARNING-TEXT PIC X(70).
03 C002-ACCOUNT-CODE PIC X(4)03 C002-NET-USER-ID PIC X(8)03 C002-PASSWORD PIC X(8)03 C002-SECTION-CODE PIC X(4).03 C002-LOGIN-STATUS PIC X.
COMMAREA is Input/Output buffer for the CICS program
The mapped Input parameters (‘LogInIn’)
The mapped Output parameter (‘LogInOut’)
CICS JCA Adapter Metadata<?xml version='1.0'?><adapter name=‘CICS' version='1.0' type='acadmin'vendor='Attunity Ltd.'>
<interaction name="logIn" mode="sync-send-receive" input="logInIn" output="logInOut"><interactionSpec program="LC0010R0"/>
</interaction><interaction name="logOff" mode="sync-send-receive" input="logOffIn" output="logOffOut">
<interactionSpec program="LC0010R0"/></interaction>
<schema version='1.0'><record name='logInIn'>
<field name='C002_NET_USER_ID' type='string' nativeType='string‘ length='8' /> <field name='C002_PASSWORD' type='string' nativeType='string‘ length='8' />
</record>
<record name='logInOut'> <field name='C002_TRANS_ID' type='string' nativeType='string'length='4' default='LY02'/> <field name='C002_SESSION_NO' type='int' nativeType='int4' /> <field name='C002_PROG_STATUS' type='int' nativeType='int2' /> <field name='C002_ERROR_COUNT' type='int' nativeType='int2' /> <field name='C002_ERROR_TABLE' type='C002_COMMAREA_C002_ERROR_TABLE‘ array='10'/> <field name='C002_LOGIN_STATUS' type='string' nativeType='string‘ length='1' />
</record>…
</schema></adapter>
Adapter Type = CICS
Adapter Interactions
In/Out Message Definition (Schema)
Native Data Type/Structure Mapping
JCA Deployment Descriptor <?xml version="1.0"?><!DOCTYPE oc4j-connector-factories PUBLIC "-//Oracle//DTD Oracle Connector 1.0//EN"
"http://xmlns.oracle.com/ias/dtds/oc4j-connector-factories.dtd">
<oc4j-connector-factories><connector-factory location="eis/attunityCICS" connector-name="Attunity Connect Legacy Adapter">
<config-property name="userName" value=""/><config-property name="password" value=""/><config-property name="eisName" value=“CICSClaimsSystem"/><config-property name="serverName" value=“myMainframe"/><config-property name="workspace" value="Navigator"/><config-property name="portNumber" value="2551"/><config-property name="persistentConnection" value=""/><config-property name="keepAlive" value=""/><connection-pooling>
<property name="scheme" value="dynamic" /><property name="maxConnections" value="10" /><property name="minConnections" value="5" />
</connection-pooling></connector-factory>…
</oc4j-connector-factories>
Define Connector Factory
Specify a JNDI location for the JCA Adapter
Adapter Connection Attributes
Connection Pooling
Using the JCA Adapter…
Context ic = new InitialContext();
String name = "java:comp/env/eis/attunityCICS";
javax.resource.cci.ConnectionFactory cf = (ConnectionFactory) ic.lookup (name);
try {
javax.resource.cci.Connection con = cf.getConnection();
Interaction interaction = con.createInteraction();
AttuInteractionSpec iSpeq = new AttuInteractionSpec("logIn");
RecordFactory rf = cf.getRecordFactory();
MappedRecord queryRecord = rf.createMappedRecord("logInIn");
queryRecord.put("@C002_NET_USER_ID",event.getUsername());
queryRecord.put("@C002_PASSWORD",event.getPassword());
Record oRec = interaction.execute(iSpeq, queryRecord);
Element outEl = ((DomRecord)oRec).getDom();
String session = (String)((MappedRecord)oRec).get("@C002_SESSION_NO");
System.out.println("SESSION IS " + session);
interaction.close();
con.close();
}
Lookup CICS JCA Adapter
Get Connection and Create Interaction (‘LogIn’)
Build interaction input document (‘LogInIn’)
Execute the interaction
Parse interaction response
Close
Other Integration Considerations
Coordinate transaction calls (transID) Firewall
– Support FIXNAT– Transparent to the App Server
Connection Pooling– Oracle side (OC4J)– Mainframe CICS side (Attunity Connect)
Performance– Pre-loaded adapter definitions and listeners
What Have We Seen?
Standard Integration APIs– JCA CCI: getConnection, createInteraction, execute...
– XML: manipulate in/out docs
Flexible Adapter Definition– Map Interactions to legacy Programs
Robust Native-data structure (e.g. COBOL) Mapping– Simple values, Arrays, Inner Structures, etc.
– Powerful manipulation of interaction messages
Other Capabilities– Transactions (expose as XAResource), Batch interactions
Bottom Line
It’s Standard (JCA CCI, XML) It’s Easy (use Java APIs and Objects) It’s Fast (proved architecture in a day)
It Works !
The Results
“It’s pretty simple to introduce new transactions, so the team can expand the claims system in almost any direction”
“By making data entry more intuitive and user friendly, we can improve throughput... This will also increase our capacity for taking on potential new business…”
Stuart Allan, XIS Convergence Program
The future of JCA
JCA 1.5 (JSR 112)
Release with J2EE 1.4 Enable inbound communication
– Transaction inflow– Message inflow
Provide JMS Provider pluggability Enhanced/new QoS Contracts
– Lifecycle management– Work management
Packaging model
JCA 2.0? Release after J2EE 1.4 Provide CCI meta-data support Add XML support to CCI Other QoS enhancements
Oracle Application Server 10g Integration
Integrate Your Business
Any Data Source
Exchanges
3rd Party Apps
E-BusinessSuite
– Improve efficiency using integrated business processes– Open, standards-based architecture– Single solution for A2A, B2B, and web services integration – Best solution pre-integrated with Oracle E-Business Suite
Custom AppsMessagingSystems
Business Process Management
B2BIntegration
WebService
Integration
EnterpriseApplicationIntegration
Single Integration Tool
Oracle Application Server 10g Integration
HTTP/S
SMTP
FTP
ebXML
RosettaNet
EDI
SOAP
B2B Services Oracle11i
SAP R3
Peoplesoft
JMS
JDBC
JCA
MQSeries
Adapters
Security Validation Transformation
Business Process Management
Trading Partner Management
Logging MonitoringTransaction
Management
Run-Time / Common Services
Design Monitor Analyze
Design Metadata Run-Time RepositoryMetadata
Tools
– Improve efficiency using integrated business processes– Common view approach minimizes impact of adding applications– Pre-certified JCA based adapters– Business process intelligence
Oracle Application Server Integration
Databases Oracle7.3, 8.0, 8i, 9i MS SQL-Server IBM DB/2 UDB Sybase Informix J2CA Datasources
Messaging Oracle AQ MQ-Series TIBCO
Applications Oracle 11.5.X Oracle 10.7 SAP R/3 SAP R/4 Peoplesoft Ariba Commerce One JD Edwards Siebel Siebel 2000 i2 Any J2CA
Application
Legacy CICS New EDI
Transports SOAP HTTP, HTTP-S SMTP FTP CORBA/IIOP COM/COM+ Generic DB Flat File
Fast Deployment via Packaged Adapters
Reminder – please complete the OracleWorld online session survey
Thank you.
AQ&Q U E S T I O N SQ U E S T I O N S
A N S W E R SA N S W E R S