Skip Headers
Oracle® Containers for J2EE Services Guide
10
g
Release 3 (10.1.3)
B14427-01
Home
Solution Area
Index
Next
Contents
Title and Copyright Information
Preface
Intended Audience
Documentation Accessibility
Related Documents
Conventions
1
Introduction to OC4J Services
1.1
Java Naming and Directory Interface (JNDI)
1.2
Java Message Service (JMS)
1.3
Data Sources
1.4
OC4J Transaction Support J
1.5
Using Remote Method Invocation in OC4J
1.6
Java Object Cache
1.7
XML Query Service
1.8
Third-Party Licenses
2
Oracle JNDI
2.1
What You Need To Know About Oracle JNDI
2.1.1
Configuring JNDI for Deployment
2.2
Initial Context
2.2.1
Creating and Using the Initial Context
2.2.2
Constructing a JNDI Context
2.2.2.1
Example: Looking Up An EJB
2.2.3
JNDI Contexts and Threads
2.3
Browsing the JNDI Context
2.4
Looking Up Objects from J2EE Application Components
2.4.1
Looking Up Objects In the Same Application
2.4.1.1
Example: Servlet Looking Up a Data Source
2.4.2
Looking Up Objects in Another Application
2.4.2.1
RMIInitialContextFactory
2.4.2.2
IIOPInitial ContextFactory
2.5
Looking Up Objects from J2EE Application Clients
2.5.1
Environment Properties
2.5.2
Load Balancing
2.5.3
Example: Application Client Looking Up an EJB
2.5.4
Example: Application Client Looking Up an EJB Using IIOP
2.6
JNDI State Replication
2.6.1
What Is JNDI State Replication
2.6.2
Enabling JNDI State Replication
2.6.3
Limitations of JNDI State Replication
2.6.3.1
Propagating Changes Across the Cluster
2.6.3.2
Binding a Remote Object
3
Oracle Enterprise Messaging Service (OEMS)
3.1
About JMS
3.1.1
JMS How-To Documents and Demo Sets
3.2
JMS Configuration Overview
3.2.1
JMS Configuration Sequence
3.2.1.1
Developing and Assembling the Application
3.2.1.2
Configuring the Resource Provider
3.2.1.3
Configuring the JMS Connector
3.2.1.4
Additional Information and Examples
3.2.2
JMS Configuration File Structure
3.2.3
Bypassing the JMS Connector for Application Clients
3.3
Resource Providers
3.3.1
Declaring Resource Provider References
3.3.2
OEMS JMS In-Memory and File-Based Persistence
3.3.2.1
Configuring Destination Objects and Connection Factories
3.3.2.2
Configuring in the Application Server Control Console
3.3.2.3
Configuration Elements
3.3.2.4
Configuration Using jms.xml
3.3.2.5
Configuring Ports
3.3.2.6
Sending and Receiving JMS Messages
3.3.2.7
JMS Utility
3.3.2.8
Configuring File-Based Persistence
3.3.2.9
Abnormal Termination
3.3.2.10
Predefined Exception Queue
3.3.2.11
Message Paging
3.3.2.12
JMS Configuration Properties
3.3.2.13
Resource Naming for OEMS JMS In-Memory and File-Based
3.3.2.14
Required Class Path for Application Clients Using Direct OEMS JMS In-Memory and File-Based Lookup
3.3.3
OEMS JMS Database Persistence
3.3.3.1
Using the OEMS JMS Database Option
3.3.3.2
Using OEMS JMS Database with the Oracle Application Server and the Oracle Database
3.3.4
Using Third-Party JMS Providers
3.3.4.1
Declaring an IBM WebSphere MQ Resource Provider Reference
3.3.4.2
Declaring a TIBCO Enterprise Message Service Resource Provider Reference
3.3.4.3
Declaring a SonicMQ Resource Provider Reference
3.4
JMS Connector
3.4.1
Modifying the JMS Connector
3.4.2
Configuring the JMS Connector
3.4.2.1
JMS Connector Connection Factories and Destinations
3.4.2.2
JMS Connector Settings
3.4.2.3
Configuring the JMS Connector in the XML Files
3.4.3
Using Message-Driven Beans
3.4.4
Using Logical Names to Reference Resources
3.4.4.1
How to Declare Logical Names
3.4.4.2
Mapping Logical Names to Explicit JNDI Locations
3.4.4.3
JNDI Naming Property Setup for Java Application Clients
3.4.4.4
Client Sends JMS Message Using Logical Names
3.4.5
Required Class Path for Application Clients Using JMS Connector Lookup
3.5
Using High Availability and Clustering for OEMS JMS
3.5.1
Configuring OEMS JMS In-Memory and File-Based High Availability
3.5.1.1
Terminology
3.5.1.2
Distributed Destinations
3.5.1.3
Cold Failover Cluster
3.5.1.4
Dedicated JMS Server
3.5.1.5
Custom Topologies
3.5.2
Configuring OEMS JMS Database High Availability
3.5.2.1
Failover Scenarios When Using a RAC Database
3.5.3
Sample Code for Connection Recovery
3.5.3.1
J2CA Configuration for Connection Recovery
3.5.4
Clustering Best Practices
3.6
JMS Router
3.6.1
Functionality
3.6.2
JMS Providers
3.6.3
Configuration
3.6.3.1
Router Jobs
3.6.3.2
Global Router Parameter(s)
3.6.3.3
Subscription
3.6.3.4
Log Queues and Exception Queues
3.6.3.5
Configuring the JMS Router and Its Objects
3.6.4
Managing the Router
3.6.4.1
Router Logging
3.6.4.2
JMS Router Status Information
3.6.4.3
Error Handling
3.6.4.4
Pausing and Resuming a Job
3.6.4.5
Running In a Clustered OC4J Environment
3.6.4.6
Routing with Remote Destinations
4
Data Sources
4.1
Data Source Types
4.1.1
Managed Data Sources
4.1.2
Native Data Sources
4.2
Defining Data Sources
4.2.1
Defining a Connection Pool
4.2.2
Defining a Managed Data Source
4.2.3
Defining a Native Data Source
4.2.4
Defining Fatal Error Codes
4.2.5
Using Password Indirection
4.3
Connections
4.3.1
Establishing a Connection
4.3.2
Using Connection Pools for Managed Data Sources
4.3.3
Using Connection Proxies with Managed Data Sources
4.3.4
Getting a Connection From a DataSource
4.3.4.1
Retry
4.4
Statements
4.4.1
Statement Caching with Managed Data Sources
4.4.1.1
Setting the JDBC Statement Cache Size in Data Sources
4.4.2
Statement Proxies with Managed Data Sources
4.5
Transactions
4.5.1
Local Transactions
4.5.1.1
Local Transaction Management
4.5.2
Global Transactions (XA)
4.5.2.1
XA Recovery
4.5.2.2
Emulating XA
4.6
Configuring Data Source Objects
4.6.1
Managed Data Sources
4.6.2
Native Data Source
4.6.3
Connection Pools and Connection Factories
4.6.3.1
Connection Factories
4.6.3.2
Connection Properties
4.6.3.3
Connection Pools
4.7
Configuration Examples
4.7.1
Syntax of the data-sources.xml File
4.7.2
Examples: Configuring Data Sources
4.7.2.1
Example: Native Data Source
4.7.2.2
Example: Managed Data Source Using an XADataSource Connection Factory
4.7.2.3
Example: Managed Data Source Using a DataSource Connection Factory
4.7.2.4
Example: Managed Data Source Using a Driver Connection Factory
4.7.2.5
Example: Defining Proxy Interfaces
4.7.2.6
Example: Defining XA Recovery
4.7.2.7
Example: Connection Properties
4.7.3
Examples: Configuring Transaction Level
4.7.4
Examples: Configuring Fast Connection Failover
4.8
Using High Availability and Fast Connection Failover
4.9
Using JDBC Drivers
4.9.1
Oracle JDBC Drivers
4.9.1.1
OCI
4.9.1.2
Thin
4.9.1.3
Notes on Oracle JDBC-OCI driver upgrade in the Oracle Application Server
4.9.2
JDBC Drivers for non-Oracle Databases
4.9.2.1
Installing and Setting Up DataDirect JDBC Drivers
4.9.2.2
Example DataDirect Data Source Entries
4.9.2.3
Additional Data Source Configuration Examples
4.10
Legacy Configuration
5
OC4J Transaction Support
5.1
Introduction to OC4J Transaction Support
5.2
Programming Models - Container-Managed and Bean-Managed Transactions
5.2.1
Demarcating Transactions
5.2.2
Demarcating Container-Managed Transactions
5.2.3
Demarcating Bean-Managed Transactions
5.3
Configuring the OC4J Transaction Manager
5.3.1
Configuring the Middle-Tier Transaction Manager in the Application Server Control Console and the JTA Resource MBean
5.3.2
Configuring Middle-Tier OC4J Transaction Support in XML Files
5.3.2.1
server.xml
5.3.2.2
transaction-manager.xml
5.3.2.3
oc4j-ra.xml
5.3.2.4
data-sources.xml
5.3.3
Configuring the In-Database Transaction Coordinator
5.4
Managing the OC4J Transaction Manager
5.4.1
Manual Commit and Rollback Operations
5.4.2
Monitoring the OC4J Transaction Manager
5.4.2.1
OC4J Transaction Support Statistics
5.4.2.2
Event Notifications
5.4.3
Managing OC4J Transaction Manager Recovery
5.5
Transaction Propagation between OC4J Processes over ORMI
5.5.1
How Does Transaction Propagation Work?
5.5.2
Configuring Transaction Propagation
5.5.3
Transaction Propagation Constraints
5.5.3.1
Backwards Compatibility
5.5.3.2
EJB Failover
5.6
Debugging and Troubleshooting
6
Using Remote Method Invocation in OC4J
6.1
What Is RMI?
6.1.1
Choosing RMI/ORMI or RMI/IIOP
6.2
Using Oracle Remote Method Invocation (RMI/ORMI)
6.2.1
Introducing RMI/ORMI
6.2.1.1
Features of ORMI
6.2.2
Configuring RMI in a Standalone OC4J Installation
6.2.2.1
Access Restrictions
6.2.3
Client-Side Requirements to Use RMI/ORMI
6.2.4
Configuring RMI in an Oracle Application Server Environment
6.3
Remote Object Lookup Using RMI/ORMI
6.3.1
Setting JNDI Properties for RMI
6.3.1.1
Setting the Java Naming Provider URL
6.3.1.2
Specifying the Context Factory
6.3.2
Configuring ORMI Request Load Balancing
6.3.3
Example Lookups Using ORMI
6.3.3.1
Standalone OC4J 10
g
Release 3 (10.1.3)
6.3.3.2
OC4J in Oracle Application Server 10
g
Release 3 (10.1.3)
6.3.3.3
OC4J in Oracle Application Server Releases Before 10
g
Release 3 (10.1.3)
6.4
Configuring ORMI Tunneling through HTTP
6.5
Using ORMI/SSL (ORMIS) in OC4J
6.6
Using J2EE Interoperability (RMI/IIOP)
6.6.1
Introduction to RMI/IIOP
6.6.1.1
Transport
6.6.1.2
Naming
6.6.1.3
Security
6.6.1.4
Transactions
6.6.1.5
The rmic.jar Compiler
6.6.2
Configuring OC4J for Interoperability
6.6.2.1
Interoperability OC4J Flags
6.6.2.2
Interoperability Configuration Files
6.6.2.3
JNDI Properties for Interoperability (jndi.properties)
6.6.3
Client-Side Requirements to Use IIOP
6.7
Switching from ORMI to IIOP Transport
6.7.1
Configuring an EJB for Interoperability in a Standalone OC4J Environment
6.7.2
Configuring an EJB for Interoperability in an Oracle Application Server Environment
6.7.3
Specifying the corbaname URL
6.7.4
Specifying the OPMN URL
6.7.5
Exception Mapping
6.7.6
Invoking OC4J-Hosted Beans from a Non-OC4J Container
7
Java Object Cache
7.1
Java Object Cache Concepts
7.1.1
Java Object Cache Basic Architecture
7.1.1.1
Distributed Object Management
7.1.2
How the Java Object Cache Works
7.1.3
Cache Organization
7.1.4
Java Object Cache Features
7.2
Java Object Cache Object Types
7.2.1
Memory Objects
7.2.2
Disk Objects
7.2.3
StreamAccess Objects
7.2.4
Pool Objects
7.3
Java Object Cache Environment
7.3.1
Cache Regions
7.3.2
Cache Subregions
7.3.3
Cache Groups
7.3.4
Region and Group Size Control
7.3.5
Cache Object Attributes
7.3.5.1
Using Attributes Defined Before Object Loading
7.3.5.2
Using Attributes Defined Before or After Object Loading
7.4
Developing Applications Using Java Object Cache
7.4.1
Importing Java Object Cache
7.4.2
Defining a Cache Region
7.4.3
Defining a Cache Group
7.4.4
Defining a Cache Subregion
7.4.5
Defining and Using Cache Objects
7.4.6
Implementing a CacheLoader Object
7.4.6.1
Using CacheLoader Helper Methods
7.4.7
Invalidating Cache Objects
7.4.8
Destroying Cache Objects
7.4.9
Multiple Object Loading and Invalidation
7.4.10
Java Object Cache Configuration
7.4.10.1
Examples
7.4.11
Declarative Cache
7.4.11.1
Declarative Cache File Sample
7.4.11.2
Declarative Cache File Format
7.4.11.3
Examples
7.4.11.4
Declarable User-Defined Objects
7.4.11.5
Declarable CacheLoader, CacheEventListener, and CapacityPolicy
7.4.11.6
Initializing the Java Object Cache in a Non-OC4J Container
7.4.12
Capacity Control
7.4.13
Implementing a Cache Event Listener
7.4.14
Restrictions and Programming Pointers
7.5
Working with Disk Objects
7.5.1
Local and Distributed Disk Cache Objects
7.5.1.1
Local Objects
7.5.1.2
Distributed Objects
7.5.2
Adding Objects to the Disk Cache
7.5.2.1
Automatically Adding Objects
7.5.2.2
Explicitly Adding Objects
7.5.2.3
Using Objects that Reside Only in Disk Cache
7.6
Working with StreamAccess Objects
7.6.1
Creating a StreamAccess Object
7.7
Working with Pool Objects
7.7.1
Creating Pool Objects
7.7.2
Using Objects from a Pool
7.7.3
Implementing a Pool Object Instance Factory
7.7.4
Pool Object Affinity
7.8
Running in Local Mode
7.9
Running in Distributed Mode
7.9.1
Configuring Properties for Distributed Mode
7.9.1.1
Setting the distribute Configuration Property
7.9.1.2
Setting the discoveryAddress Configuration Property
7.9.2
Using Distributed Objects, Regions, Subregions, and Groups
7.9.2.1
Using the REPLY Attribute with Distributed Objects
7.9.2.2
Using SYNCHRONIZE and SYNCHRONIZE_DEFAULT
7.9.3
Accessing Objects in Remote Caches
7.9.4
Cached Object Consistency Levels
7.9.4.1
Using Local Objects
7.9.4.2
Propagating Changes Without Waiting for a Reply
7.9.4.3
Propagating Changes and Waiting for a Reply
7.9.4.4
Serializing Changes Across Multiple Caches
7.9.5
Sharing Cached Objects in an OC4J Servlet
7.9.6
Using User-Defined Class Loaders
7.9.7
HTTP and Security for Distributed Cache
7.9.7.1
HTTP
7.9.7.2
SSL
7.9.7.3
Firewall
7.9.7.4
Restricting Incoming Connections
7.10
Monitoring and Debugging
7.11
XML Schema for Cache Configuration
7.12
XML Schema for Attribute Declaration
8
XML Query Service
8.1
Introduction to XML Query Service
8.1.1
What is XQS?
8.1.2
Technologies Related to XQS
8.1.2.1
A Quick Look at XQuery
8.1.2.2
The Oracle XQuery Implementation
8.1.2.3
Comparing XQS with the XQuery API for Java
8.1.3
Why Use XQS?
8.1.4
Requirements, Limitations, and Special Notes for the Current Release
8.2
Overview of XQS Features and Functionality
8.2.1
XQS Data Source Support
8.2.1.1
Supported Categories of Data Sources
8.2.1.2
Data Source Access Through XQuery Functions
8.2.1.3
What Do Data Source Function Objects Do?
8.2.1.4
Overview of Preparing Data Sources
8.2.2
Introduction to XQS Configuration and Configuration Files
8.2.3
Introduction to XQS Client Interfaces
8.2.4
Introduction to OC4JPackager
8.2.5
Security for XQS Applications
8.2.6
Introduction to XQS Performance and Optimization Features
8.2.7
Introduction to XQS Error Handling
8.2.8
Summary of the Main Steps in Using XQS
8.3
How to Enable XQS As an OC4J Extension
8.4
How to Prepare to Use Your Data Sources
8.4.1
Preparing to Use a Non-XML Document Source
8.4.1.1
What is D3L?
8.4.1.2
D3L Schema Files
8.4.1.3
Configuring XQS to Use D3L
8.4.2
Preparing to Use an XQS View
8.4.3
Preparing to Use a WSDL Source with SOAP Binding
8.4.4
Preparing to Use a Database Source (WSDL Source with SQL Binding)
8.4.5
Preparing to Use a Custom Class or EJB (WSDL Source with Java or EJB Binding)
8.5
How to Configure Your XQS Functions
8.5.1
Configuring an XQS Function That Accesses a Document Source
8.5.2
Configuring an XQS Function That Uses an XQS View
8.5.3
Configuring an XQS Function That Accesses a WSDL Source
8.6
How to Design Your Queries
8.6.1
Query Considerations
8.6.2
Query Examples
8.6.3
Type-Checking for Input Parameters
8.7
How to Develop Your Application Code: Using the XQS Client Interfaces
8.7.1
Supported Types for Query Parameters
8.7.2
General Coding Steps in Using XQS Client APIs
8.7.3
Stateful Versus Stateless Clients
8.7.4
Using the Java Class Client API
8.7.4.1
Example 1: XQSFacade API with an Ad-Hoc Query
8.7.4.2
Example 2: XQSFacade API with an Ad-Hoc Query
8.7.4.3
Example 3: XQSFacade API with an XQS View
8.7.5
Using the EJB Client API
8.7.5.1
EJB Clients for Stateful Versus Stateless Sessions
8.7.5.2
Use of the EJB Client API in Stateful Sessions
8.7.5.3
Example: EJB Client API with an XQS View in a Stateless Session
8.7.6
Using the JSP Tag Library
8.7.6.1
JSP Tags for Stateful Versus Stateless Access
8.7.6.2
Example: JSP Tags with an XQS View in a Stateful Access Pattern
8.7.6.3
Example: JSP Tags with an Ad-Hoc Query in a Stateless Access Pattern
8.7.7
Using an XQS View Exposed as a Web Service Operation
8.8
How to Use OC4JPackager to Package Your XQS Application
8.8.1
Steps in Using OC4JPackager
8.8.1.1
Preparing to Run OC4JPackager
8.8.1.2
Running OC4JPackager: Required and Optional Parameters and Properties
8.8.2
Running OC4JPackager on the Command Line
8.8.3
Running OC4JPackager Through Ant
8.8.4
OC4JPackager Basic Output
8.8.5
OC4JPackager Additional Output to Expose XQS Views as Web Service Operations
8.8.5.1
Example: Configuration to Expose a View as a Web Service Operation
8.8.5.2
Example: EAR File for a View Exposed as a Web Service Operation
8.8.5.3
Example: WAR File for a View Exposed as a Web Service Operation
8.8.5.4
Example: WSDL document for a View Exposed as a Web Service Operation
8.9
Using XQS Performance Features
8.9.1
Performance Considerations for Using the XQS Stateless or Stateful Client APIs
8.9.2
Configuring XQS Caching
8.9.2.1
Configure XQS Cache Settings
8.9.2.2
XQS Caching Strategies
8.9.2.3
Caching and Nondeterministic Results
8.9.3
Configuring XQS Document or View Sources for Large Data
8.9.4
XQS XPath Optimization for WSDL Sources with SQL Binding
8.10
Using XQS Error Handling Modes and APIs
8.10.1
Configuring XQS Function Error Handling
8.10.2
Retrieving XQS Error Objects
8.10.3
Obtaining Information from XQS Error Objects
8.10.4
Example: Error Retrieval and Processing
8.11
XQS Client APIs Reference
8.11.1
XQS QueryParameter Class Reference
8.11.1.1
QueryParameter Constructors
8.11.1.2
QueryParameter Methods
8.11.2
XQSFacade Class Reference
8.11.2.1
XQSFacade Constructor
8.11.2.2
XQSFacade Methods
8.11.3
XQS EJB Client API Reference
8.11.3.1
Stateful EJB Client Methods
8.11.3.2
Stateless EJB Client Methods
8.11.4
XQS JSP Tag Library Reference
8.11.4.1
JSP Tags for Stateful Access
8.11.4.2
JSP Tags for Stateless Access
8.11.5
XQSError Class Reference
8.12
XQS Configuration File Reference
8.12.1
<bind-prefix>
8.12.2
<cache-properties>
8.12.3
<document-source>
8.12.4
<documentURL>
8.12.5
<error-message>
8.12.6
<function-name>
8.12.7
<in-memory>
8.12.8
<input-parameters>
8.12.9
<itemType>
8.12.10
<mapping>
8.12.11
<operation>
8.12.12
<output-element>
8.12.13
<part>
8.12.14
<password>
8.12.15
<port>
8.12.16
<portType>
8.12.17
<queryName>
8.12.18
<repository>
8.12.19
<schema-file>
8.12.20
<schema-type>
8.12.21
<service>
8.12.22
<typeMap>
8.12.23
<use-prefix>
8.12.24
<username>
8.12.25
<wsdl-source>
8.12.26
<wsdlURL>
8.12.27
<xqs-config>
8.12.28
<xqs-sources>
8.12.29
<xqsview-source>
8.12.30
<XMLTranslate>
8.12.31
<xmlType>
8.12.32
<xquery-sequence>
8.13
OC4JPackager Reference
8.13.1
OC4JPackager Parameters
8.13.1.1
appArchives
8.13.1.2
globalXqsConfig
8.13.1.3
help
8.13.1.4
jsp
8.13.1.5
name
8.13.1.6
output
8.13.1.7
repository
8.13.1.8
sf
8.13.1.9
sl
8.13.1.10
xqsConfigFile
8.13.2
Java Properties for OC4JPackager
8.13.2.1
oracle.home
8.13.2.2
java.home
8.13.2.3
java.util.logging.properties.file
8.13.2.4
xds.packager.work.dir
8.14
Summary of XQS MBeans and Administration
8.14.1
General Overview of OC4J MBean Administration
8.14.2
Summary of XQS MBeans
8.15
XQS Troubleshooting
8.15.1
Enabling OC4J Logging
8.15.2
Key XQS Symptoms, Causes, and Remedies
8.16
XQS Sample
A
Third Party Licenses
A.1
ANTLR
A.1.1
The ANTLR License
A.2
Apache
A.2.1
The Apache Software License
A.3
Apache SOAP
A.3.1
Apache SOAP License
A.4
DBI Module
A.4.1
Perl Artistic License
A.4.1.1
Preamble
A.4.1.2
Definitions
A.5
expat
A.6
FastCGI
A.6.1
FastCGI Developer's Kit License
A.6.2
Module mod_fastcgi License
A.7
Info-ZIP Unzip Package
A.7.1
The Info-ZIP Unzip Package License
A.8
Jabberbeans
A.9
JSR 110
A.10
Jaxen
A.10.1
The Jaxen License
A.11
JGroups
A.11.1
The GNU License
A.12
JTidy
A.13
mod_dav
A.14
mod_mm and mod_ssl
A.15
OpenSSL
A.15.1
OpenSSL License
A.16
Perl
A.16.1
Perl Kit Readme
A.16.2
mod_perl 1.29 License
A.16.3
mod_perl 1.99_16 License
A.16.4
Perl Artistic License
A.16.4.1
Preamble
A.16.4.2
Definitions
A.17
PHP
A.17.1
The PHP License
A.18
SAXPath
A.18.1
The SAXPath License
A.19
Sun Microsystems, Inc.
A.19.1
The Java Logo
A.20
W3C DOM
A.20.1
The W3C License
Index