Skip Headers
Oracle® Containers for J2EE Enterprise JavaBeans Developer's Guide
10
g
(10.1.3.1.0)
Part Number B28221-02
Home
Book List
Index
Contact Us
Next
View PDF
Contents
List of Examples
List of Figures
List of Tables
Title and Copyright Information
Preface
Audience
Documentation Accessibility
Related Documents
Conventions
Part I EJB Overview
1
Understanding Enterprise JavaBeans
What are Enterprise JavaBeans?
What is the Anatomy of an EJB 3.0 enterprise bean?
What is the Anatomy of an EJB 2.1 Enterprise Bean?
What is the Life Cycle of an Enterprise Bean?
Life Cycle Callback Methods on a Bean Class
Life Cycle Callback Interceptor Methods on an EJB 3.0 Interceptor Class
Life Cycle Callback Listener Methods on a JPA Entity Listener Class
What is EJB Context?
How do Annotations and Resource Injection Work?
Annotations in the Web Tier
Annotations and Inheritance
Overriding Annotations With Deployment Descriptor Entries
OC4J Support for Annotation Attribute mappedName
What is a Session Bean?
What is a Stateless Session Bean?
What is the Stateless Session Bean Life Cycle?
What is a Stateful Session Bean?
What is the Life Cycle of a Stateful Session Bean?
What is Session Context?
What is a JPA Entity?
What are JPA Entity Container-Managed Persistent Fields?
What are JPA Entity Container-Managed Relationship Fields?
What is the JPA Entity Life Cycle?
What is a JPA Entity Primary Key?
How do you Query for a JPA Entity?
Understanding the JPA EntityManager Query API
Understanding JPA Entity Query Syntax
What is an EJB 2.1 Entity Bean?
What is an EJB 2.1 Entity Bean With Container-Managed Persistence?
What are Container-Managed Persistent Fields?
What are Container-Managed Relationship Fields?
What is the Life Cycle of an EJB 2.1 Entity Bean With Container-Managed Persistence?
What is a Primary Key of an Entity Bean With Container-Managed Persistence?
What is an EJB 2.1 Entity Bean With Bean-Managed Persistence?
What are Bean-Managed Persistent Fields?
What are Bean-Managed Relationship Fields?
What is the Life Cycle of an EJB 2.1 Entity Bean With Bean-Managed Persistence?
What is a Primary Key of an Entity Bean With Bean-Managed Persistence?
What is Entity Context?
When Does Entity Bean Passivation Occur?
What are Entity Bean Commit Options?
Commit Options and CMP Applications
Commit Options and BMP Applications
How do you Query for an EJB 2.1 Entity Bean?
Understanding EJB 2.1 Query Syntax
Understanding Finder Methods
Understanding Select Methods
What is a Message-Driven Bean?
What is the Life Cycle of a Message-Driven Bean?
What is Message Driven Context?
Which Type of Enterprise Bean Should You Use?
Which Type of Session Bean Should You Use?
When do you use Bean-Managed Versus Container-Managed Persistence?
How do you Avoid Database Resource Contention?
Transaction Isolation
Concurrency (Locking) Mode
2
Understanding EJB Application Development
Using EJB Development Tools
Using JDeveloper
Using Eclipse
Using TopLink Workbench
What OC4J Services Can You Use With an EJB?
How do you Package and Deploy an EJB Application?
Understanding Packaging
Understanding Deployment
In What Order Does OC4J Deploy EJB Modules?
Understanding EJB Deployment Descriptor Files
What is the ejb-jar.xml File?
EJB 3.0
EJB 2.1
XML Reference
What is the orion-ejb-jar.xml File?
EJB 3.0
EJB 2.1
XML Reference
What is the toplink-ejb-jar.xml File?
EJB 3.0
EJB 2.1
XML Reference
What is the ejb3-toplink-sessions.xml File?
EJB 3.0
EJB 2.1
XML Reference
What is the persistence.xml File?
Understanding OC4J Persistence Unit Defaults
EJB 3.0
EJB 2.1
XML Reference
What is the orm.xml File?
EJB 3.0
EJB 2.1
XML Reference
How do you use an Enterprise Bean in Your Application?
Understanding Client Access
Understanding EJB 3.0 Interceptors
Interceptor Restrictions
Singleton Interceptors
Understanding EJB and Web Services
Understanding EJB Administration
Understanding EJB Persistence Services
Understanding EJB JNDI Services
Understanding EJB Data Source Services
What Types of Data Source Does OC4J Support?
Managed Data Source
Native Data Source
How do you Define a Connection URL in OC4J?
What Transaction Types do Data Sources Support?
Where do you Configure Data Source Information in OC4J?
What is a Default Data Source?
How Does OC4J Handle Multiple Data Sources?
Understanding EJB Transaction Services
Who Manages a Transaction?
What are Container-Managed Transactions?
What are Bean-Managed Transactions?
How are Transactions Handled When a Client Invokes a Business Method?
How do You Participate in a Global or Two-Phase Commit (2PC) Transaction?
Understanding EJB Security Services
Understanding Message Services
What Message Service Providers Can you use With Your MDB?
Oracle JMS Connector: J2EE Connector Architecture (J2CA)-Based Provider
OEMS JMS: In-Memory or File-Based Provider
OEMS JMS Database: Advanced Queueing (AQ)-Based Provider
Restrictions When Accessing a Message Service Provider Without a J2CA Resource Adapter
Message Service Configuration Options: Annotations or XML? Attributes or Activation Configuration Properties?
Message Service Configuration Using Annotations
Message Service Configuration Using XML
Configuring Message Services for Two-Phase Commit (2PC) Transactions
MDB Auto-Enlisting in Two-Phase Commit (2PC) XA Transactions
Understanding OC4J EJB Application Clustering Services
State Replication
Load Balancing
Understanding EJB Timer Services
Understanding Java EE Timer Services
Understanding OC4J Cron Timer Services
3
Understanding EJB Support in OC4J
EJB 3.0 Support
What JDK is Required?
How do You Define an EJB 3.0 Application?
How Does OC4J Manage Persistence in an EJB 3.0 Application?
TopLink Essentials JPA Persistence Provider
JPA Persistence JAR Files
Customizing the JPA Persistence Provider
Accessing TopLink API at Run Time With TopLink Essentials JPA Persistence
Accessing TopLink API at Run Time With TopLink JPA Preview Persistence
Migrating a 10.1.3.0 TopLink JPA Preview Application to 10.1.3.1 TopLink Essentials JPA
Changes in OC4J Configuration Files
Changes in javax.persistence
Changes in oracle.toplink.essentials.platform.database
Changes in Interceptor Support
Acquiring an Entity Manager
New JAR Files
EJB 2.1 Support
What JDK is Required?
How do you Define an EJB 2.1 Module?
How Does OC4J Manage Persistence in an EJB 2.1 Application?
TopLink EJB 2.1 Persistence Manager
EJB 2.1 Persistence JAR Files
Customizing the TopLink EJB 2.1 Persistence Manager
Migrating to the TopLink EJB 2.1 Persistence Manager
Part II EJB 3.0 Session Beans
4
Implementing an EJB 3.0 Session Bean
Implementing an EJB 3.0 Stateless Session Bean
Implementing an EJB 3.0 Stateful Session Bean
Adapting an EJB 3.0 Stateless Session Bean for an EJB 2.1 Client
Using Annotations
Adapting an EJB 3.0 Stateful Session Bean for an EJB 2.1 Client
Using Annotations
5
Using an EJB 3.0 Session Bean
Configuring Passivation
Using Deployment XML
Configuring Passivation Criteria
Using Annotations
Using Deployment XML
Configuring Passivation Location
Using Annotations
Using Deployment XML
Configuring a Life Cycle Callback Interceptor Method on an EJB 3.0 Session Bean
Using Annotations
Configuring a Life Cycle Callback Interceptor Method on an Interceptor Class of an EJB 3.0 Session Bean
Using Annotations
Configuring an Around Invoke Interceptor Method on an EJB 3.0 Session Bean
Using Annotations
Configuring an Around Invoke Interceptor Method on an Interceptor Class of an EJB 3.0 Session Bean
Using Annotations
Configuring an Interceptor Class for an EJB 3.0 Session Bean
Using Annotations
Creating an Interceptor Class
Associating an Interceptor Class With a Session Bean
Specifying Singleton Interceptors in a Session Bean
Configuring OC4J-Proprietary Deployment Options on an EJB 3.0 Session Bean
Using Annotations
Using Deployment XML
Part III JPA Entities
6
Implementing a JPA Entity
Implementing a JPA Entity
7
Using Java Persistence API
Configuring a JPA Entity Primary Key
Configuring a JPA Entity Simple Primary Key Field
Using Annotations
Configuring a JPA Entity Composite Primary Key Class
Using Annotations
Configuring JPA Entity Automatic Primary Key Generation
Using Annotations
Configuring Table and Column Information
Configuring the Primary Table
Using Annotations
Configuring a Secondary Table
Using Annotations
Configuring a Column
Using Annotations
Configuring a Join Column
Using Annotations
Configuring a Container-Managed Relationship Field for a JPA Entity
Configuring a Basic Mapping
Using Annotations
Configuring a Large Object Mapping
Using Annotations
Configuring a Serialized Object Mapping
Using Annotations
Configuring an One-to-One Mapping
Using Annotations
Configuring a Many-to-One Mapping
Using Annotations
Configuring an One-to-Many Mapping
Using Annotations
Configuring a Many-to-Many Mapping
Using Annotations
Configuring an Aggregate Mapping
Using Annotations
Configuring Optimistic Lock Version Field
Using Annotations
Configuring Lazy Loading
Using Annotations
Configuring a Life Cycle Callback Method on a JPA Entity
Using Annotations
Configuring a Life Cycle Callback Listener Method on an Entity Listener Class of a JPA Entity
Using Annotations
Configuring Inheritance for a JPA Entity
Joined Subclass
Single Table for Each Class Hierarchy
Using Annotations
Configuring Joined Subclass Inheritance With Annotations
Configuring Single Table Inheritance With Annotations
8
Implementing JPA Queries
Implementing a JPA Named Query
Using Annotations
Implementing a JPA Dynamic Query
Using Java
Configuring TopLink Query Hints in a JPA Query
Part IV EJB 3.0 Message-Driven Beans
9
Implementing an EJB 3.0 Message-Driven Bean
Implementing an EJB 3.0 MDB
10
Using an EJB 3.0 Message-Driven Bean
Configuring an EJB 3.0 MDB to Access a Message Service Provider Using J2CA
Using Annotations
Using Deployment XML
Configuring an EJB 3.0 MDB to Access a Message Service Provider Directly
Using Annotations
Using Deployment XML
Configuring Parallel Message Processing
Using Annotations
Using Deployment XML
Configuring Maximum Delivery Count
Using Annotations
Using Deployment XML
Configuring Connection Failure Recovery for an EJB 3.0 MDB
Using Annotations
Using Deployment XML
Configuring a Life Cycle Callback Interceptor Method on an EJB 3.0 MDB
Using Annotations
Configuring a Life Cycle Callback Interceptor Method on an Interceptor Class of an EJB 3.0 MDB
Using Annotations
Configuring an Around Invoke Interceptor Method on an EJB 3.0 MDB
Using Annotations
Configuring an Around Invoke Interceptor Method on an Interceptor Class of an EJB 3.0 MDB
Using Annotations
Configuring an Interceptor Class for an EJB 3.0 MDB
Using Annotations
Creating an Interceptor Class
Associating an Interceptor Class With an MDB
Specifying Singleton Interceptors in an MDB
Configuring OC4J-Proprietary Deployment Options on an EJB 3.0 MDB
Using Annotations
Using Deployment XML
Part V EJB 2.1 Session Beans
11
Implementing an EJB 2.1 Session Bean
Implementing an EJB 2.1 Stateless Session Bean
Using Java
Using Deployment XML
Implementing an EJB 2.1 Stateful Session Bean
Using Java
Using Deployment XML
Implementing the Home Interfaces
Implementing the Remote Home Interface
Implementing the Local Home Interface
Implementing the Component Interfaces
Implementing the Remote Component Interface
Implementing the Local Component Interface
Implementing the setSessionContext Method
12
Using an EJB 2.1 Session Bean
Configuring Passivation
Using Deployment XML
Configuring Passivation Criteria
Using Deployment XML
Configuring Passivation Location
Using Deployment XML
Configuring a Life Cycle Callback Method for an EJB 2.1 Session Bean
Using Java
Part VI EJB 2.1 Entity Beans
13
Implementing an EJB 2.1 Entity Bean
Implementing an EJB 2.1 Entity Bean With Container-Managed Persistence
Using Java
Using Deployment XML
Implementing an EJB 2.1 Entity Bean With Bean-Managed Persistence
Using Java
Using Deployment XML
Implementing an ejbCreate Method for an EJB 2.1 Entity Bean With Bean-Managed Persistence
Implementing the EJB 2.1 Home Interfaces
Implementing the Remote Home Interface
Implementing the Local Home Interface
Implementing the EJB 2.1 Component Interfaces
Implementing the Remote Component Interface
Implementing the Local Component Interface
Implementing the setEntityContext and unsetEntityContext Methods
14
Using an EJB 2.1 Entity Bean With Container-Managed Persistence
Configuring a Primary Key for an EJB 2.1 Entity Bean With Container-Managed Persistence
Configuring a Primary Key Field for an EJB 2.1 Entity Bean With Container-Managed Persistence
Using Deployment XML
Configuring a Composite Primary Key Class for an EJB 2.1 Entity Bean With Container-Managed Persistence
Using Java
Using Deployment XML
Configuring Table and Column Information
Configuring Automatic Database Table Creation
Using Deployment XML
Configuring Default Relationship Generation
Using Deployment XML
Configuring a Container-Managed Persistent Field for an EJB 2.1 Entity Bean With Container-Managed Persistence
Using Java
Using Deployment XML
Configuring a Container-Managed Relationship Field for an EJB 2.1 Entity Bean With Container-Managed Persistence
Using Java
Using Deployment XML
Configuring a One-to-One Relationship
Using Deployment XML
Configuring a One-to-Many Relationship
Using Deployment XML
Configuring a Many-to-One Relationship
Using Deployment XML
Configuring a Many-to-Many Relationship
Using Deployment XML
Configuring Lazy Loading on Finder Methods
Using Deployment XML
Configuring a Life Cycle Callback Method for an EJB 2.1 Entity Bean With Container-Managed Persistence
Using Java
15
Using an EJB 2.1 Entity Bean With Bean-Managed Persistence
Configuring a Primary Key for an EJB 2.1 Entity Bean With Bean-Managed Persistence
Configuring a Primary Key Field for an EJB 2.1 Entity Bean With Bean-Managed Persistence
Using Deployment XML
Configuring a Primary Key Class for an EJB 2.1 Entity Bean With Bean-Managed Persistence
Using Java
Using Deployment XML
Configuring a Read-Only Entity Bean With Bean-Managed Persistence
Using Deployment XML
Configuring Commit Options for an Entity Bean With Bean-Managed Persistence
Using Deployment XML
Configuring a Query for an EJB 2.1 Entity Bean With Bean-Managed Persistence
Implementing an ejbFindByPrimaryKey Method for an EJB 2.1 Entity Bean With Bean-Managed Persistence
Implementing Other Finder Methods for a EJB 2.1 Entity Bean With Bean-Managed Persistence
Configuring a Life Cycle Callback Method for an EJB 2.1 Entity Bean With Bean-Managed Persistence
Using Java
16
Implementing EJB 2.1 Queries
Implementing an EJB 2.1 EJB QL Finder Method
Using Java
Using Deployment XML
Using TopLink Workbench
Implementing an EJB 2.1 EJB QL Select Method
Using Java
Using Deployment XML
Using TopLink Workbench
OC4J EJB 2.1 EJB QL Extensions
Part VII EJB 2.1 Message-Driven Beans
17
Implementing an EJB 2.1 Message-Driven Bean
Implementing an EJB 2.1 MDB
Using Java
Using Deployment XML
Implementing the setMessageDrivenContext Method
18
Using an EJB 2.1 Message-Driven Bean
Configuring an EJB 2.1 MDB to Access a Message Service Provider Using J2CA
Using Deployment XML
Configuring an EJB 2.1 MDB to Access a Message Service Provider Directly
Using Deployment XML
Configuring an MDB for Fast Undeploy on Windows Operating System
Using System Properties
Configuring an MDB for Oracle RAC Failover
Using Deployment XML
Using Java
Configuring Parallel Message Processing
Using Deployment XML
Configuring Maximum Delivery Count
Using Deployment XML
Configuring Connection Failure Recovery for an EJB 2.1 MDB
Using Deployment XML
Configuring a Life Cycle Callback Method for an EJB 2.1 MDB
Using Java
Part VIII Configuring OC4J EJB Services
19
Configuring JNDI Services
Configuring Environment References
EJB Environment References
Resource Manager Connection Factory Environment References
Environment Variable Environment References
Web Service Environment References
Persistence Context References
Where do you Configure an EJB Environment Reference?
Should you use Logical Names?
Configuring an Environment Reference to a Remote EJB: Clustered or Combined Web Tier and EJB Tier
Configuring ejb-ref in the Client: No Indirection
Configuring ejb-ref in the Client: Using ejb-link to Resolve Indirection
Configuring ejb-ref in the Client: Using orion-ejb-jar.xml ejb-ref-mapping to Resolve Indirection
Configuring an Environment Reference to a Remote EJB: Unclustered Separate Web Tier and EJB Tier
Using Deployment XML
Configuring an Environment Reference to a Local EJB
Configuring ejb-local-ref in the Client: No Indirection
Configuring ejb-local-ref in the Client: Using ejb-link to Resolve Indirection
Configuring ejb-local-ref in the Client: Using orion-ejb-jar.xml ejb-ref-mapping to Resolve Indirection
Configuring an Environment Reference to a JDBC Data Source Resource Manager Connection Factory
Using Deployment XML
Configuring an Environment Reference to a JMS Destination Resource Manager Connection Factory (JMS 1.1)
Configuring an Environment Reference to a JMS Destination or Connection Resource Manager Connection Factory (JMS 1.0)
Using Deployment XML
Configuring an Environment Reference to an Environment Variable
Configuring an Environment Reference to a Web Service
Configuring an Environment Reference to a Persistence Context
Configuring the Initial Context Factory
Configuring the Default Initial Context Factory
Configuring an Oracle Initial Context Factory
Configuring the Naming Provider URL for OC4J and Oracle Application Server
Configuring the Naming Provider URL for OC4J Standalone
Setting JNDI Properties in an Enterprise Bean
Setting JNDI Properties With the JNDI Properties File
Setting JNDI Properties With System Properties
Setting JNDI Properties in the Initial Context
Looking Up an EJB 3.0 Resource Manager Connection Factory
Using Annotations
Using Initial Context
Looking Up an EJB 3.0 Environment Variable
Using Resource Injection
Using Initial Context
Looking Up an EJB 2.1 Resource Manager Connection Factory
Using Initial Context
Looking Up an EJB 2.1 Enviornment Variable
Using Initial Context
20
Configuring Data Sources
Configuring a Data Source for an Oracle Database
Using Application Server Control Console
Using Deployment XML
Configuring a Data Source for a Third-Party Database
Using Application Server Control Console
Using Deployment XML
Configuring a Default Data Source for an EJB 3.0 Application
Using Deployment XML
Configuring a Default Data Source for an EJB 2.1 Application
Using Deployment XML
Associating TopLink With an Oracle JDBC Driver
EJB 3.0 and EJB 2.1 non-CMP Applications
EJB 2.1 CMP Applications
EIS AQ Connector Applications
21
Configuring Transaction Services
Configuring EJB 3.0 Transaction Management
Using Annotations
Using Deployment XML
Configuring an EJB 3.0 Transaction Attribute
Using Annotations
Using Deployment XML
Configuring EJB 2.1 Transaction Management
Using Deployment XML
Configuring an EJB 2.1 Transaction Attribute
Using Deployment XML
Configuring Transaction Timeouts
Configuring a Global Transaction Timeout
Using Application Server Control Console
Using Deployment XML
Configuring a Transaction Timeout for a Session Bean
Using Annotations
Using Deployment XML
Configuring a Transaction Timeout for a Message-Driven Bean
Using Annotations
Using Deployment XML
Transaction Best Practices
Using Container Managed Transactions With Datasource Connections
Using a Rollback Strategy
22
Configuring Security Services
Granting Permissions in Browser
Defining Users, Groups, and Roles in an EJB Application
Specifying Users and Groups
Specifying Logical Roles in the EJB Deployment Descriptor
Specifying a Role for an EJB Method
Using Annotations
Using Deployment XML
Specifying Unchecked Security for EJB Methods
Using Annotations
Using Deployment XML
Specifying the runAs Security Identity
Using Annotations
Using Deployment XML
Mapping Logical Roles to Users and Groups
Specifying a Default Role Mapping for Undefined Methods
Specifying Users and Groups by the Client
Specifying Credentials in EJB Clients
Specifying Credentials in JNDI Properties
Specifying Credentials in the Initial Context
Specifying EJB Client Security Properties in the ejb_sec.properties File
Using EJB 3.0 Security Annotations
Using Annotations
Retrieving Credentials From an Enterprise Bean Using the JAAS API
Defining a Custom JAAS Login Module for an EJB Application
23
Configuring Message Services
Configuring a J2CA Resource Adapter for use With Your Message Service Provider
J2CA Message Service Provider Connection Factory Names
Installing and Configuring a J2CA Adapter
Configuring OC4J J2CA Resource Adapter Deployment XML Files
Configuring an OEMS JMS Message Service Provider
OEMS JMS Destination and Connection Factory Names
Configuring jms.xml
Configuring an OEMS JMS Database Message Service Provider
OEMS JMS Database Destination and Connection Factory Names
Installing and Configuring the OEMS JMS Database Provider
Configuring data-sources.xml
Configuring application.xml or orion-application.xml
24
Configuring OC4J EJB Application Clustering Services
Configuring EJB 3.0 and EJB 2.1 Stateful Session Bean Replication Policy
Using Deployment XML
Overriding Application-Level Replication Policy in the orion-ejb-jar.xml File for EJB Components
Configuring Static Retrieval Load Balancing
Using JNDI Properties
Configuring DNS Load Balancing
Using JNDI Properties
Configuring Load Balancing Behavior
Using System Properties
25
Configuring Timer Services
Configuring an Enterprise Bean With a Java EE Timer
Configuring an Enterprise Bean With an OC4J Cron Timer
Troubleshooting Timers
Retrieving Information About a Timer
Retrieving a Persisted Timer
Executing a Timer Within the Scope of a Transaction
What Does a NoSuchObjectLocalException Mean With Timers?
Part IX Packaging and Deploying an EJB Application
26
Configuring Deployment Descriptor Files
Configuring the ejb-jar.xml File
Creating ejb-jar.xml During Migration
Creating the ejb-jar.xml File at Deployment Time
Creating ejb-jar.xml With JDeveloper
Configuring the toplink-ejb-jar.xml File
Creating toplink-ejb-jar.xml During Migration
Creating toplink-ejb-jar.xml With TopLink Workbench
Configuring the orion-ejb-jar.xml File
Configuring the ejb3-toplink-sessions.xml File
Creating ejb3-toplink-sessions.xml With TopLink Workbench
Configuring the persistence.xml File
Configuring the persistence.xml With a Named Persistence Unit File
What Persistent Managed Classes Does This Persistence Unit Include?
Configuring the persistence.xml File for the OC4J Default Persistence Unit
Specifying a Data Source in a Persistence Unit
Configuring Vendor Extensions in a Persistence Unit
TopLink JPA Extensions for JDBC (Java SE)
TopLink JPA Extensions for Caching
TopLink JPA Extensions for Logging
TopLink JPA Extensions for Database, Session, and Application Server
TopLink JPA Extensions for Customization
TopLink JPA Extensions for Schema Generation
27
Packaging an EJB Application
Packaging a JPA Entity Application
Packaging a Persistence Unit
Creating a Persistence Archive
Packaging Persistence Unit Files Directly in Java EE Modules
Packaging Mapping Metadata
Packaging an Application With Both EJB 3.0 and EJB 2.1 Enterprise Beans
Sharing Classes Between EJB Applications
Handling Out of Memory Exceptions at Run Time
Handling Class Cast Exceptions at Run Time
28
Deploying an EJB Application to OC4J
Deploying a Large EJB Application
Tuning the VM to Avoid Out Of Memory Errors During Deployment
Configuring the Temp Directory to Avoid Out Of Memory Errors During Deployment
Disabling Batch Compilation to Avoid Out Of Memory Errors During Deployment
Deploying Incrementally
Expanded Deployment
Troubleshooting Application Deployment
Part X Using an EJB in Your Application
29
Accessing an Enterprise Bean From a Client
What Type of Client do you Have?
EJB Client
Standalone Java Client
Servlet or JSP Client
Configuring the Client
Configuring the Client Classpath for OC4J
Selecting an Initial Context Factory Class
Specifying Security Credentials
Selecting an EJB Reference
Accessing an EJB 3.0 Enterprise Bean
Using Annotations
Using Initial Context
Looking Up the Remote Interface of an EJB 3.0 Enterprise Bean Using ejb-ref
Looking Up the Remote Interface of an EJB 3.0 Enterprise Bean Using location
Looking up the Local Interface of an EJB 3.0 Enterprise Bean Using local-ref
Looking up the Local Interface of an EJB 3.0 Enterprise Bean Using local-location
Accessing an EJB 3.0 Enterprise Bean in Another Application
Accessing a JPA Entity Using an EntityManager
Acquiring an EntityManager
Acquiring the OC4J Default Entity Manager
Acquiring a Named Entity Manager
Acquiring an Entity Manager Using JNDI
Acquiring an Entity Manager in a Web Client
Acquiring an Entity Manager in a Helper Class
Creating a New Entity Instance
Querying for a JPA Entity Using the EntityManager
Finding an Entity by Primary Key With the Entity Manager
Creating a Named Query With the EntityManager
Creating a Dynamic Java Persistence Query Language Query With the Entity Manager
Creating a Dynamic TopLink Expression Query With the EntityManager
Creating a Dynamic Native SQL Query With the EntityManager
Executing a Query
Modifying an Entity Instance
Using an Updating Query
Using the Entity's Public API
Refreshing From the Database
Removing an Entity
Using Flush
Detaching and Merging an Entity Bean Instance
Sending a Message to a JMS Destination Using EJB 3.0
Accessing an EJB 3.0 EJBContext
Using Resource Injection
Accessing an EJB 2.1 Enterprise Bean
Accessing an EJB 2.1 Enterprise Bean Remotely
Accessing an EJB 2.1 Enterprise Bean Locally
Accessing an EJB 2.1 Enterprise Bean Using RMI From a Standalone Java Client
Accessing an EJB 2.1 Enterprise Bean From an EJB 3.0 Client
Accessing an EJB 2.1 Enterprise Bean in Another Application
Sending a Message to a JMS Destination Using EJB 2.1
Accessing an EJB 2.1 EJBContext
Handling Parameters
Passing Parameters Into an Enterprise Bean
Handling Parameters Returned by an Enterprise Bean
Handling Exceptions
Recovering From a NamingException While Accessing a Remote Enterprise Bean
Recovering From a NullPointerException While Accessing a Remote Enterprise Bean
Recovering From Deadlock Conditions
30
Using EJB and Web Services
Exposing a Stateless Session Bean as a Web Service
Using Annotations
Accessing a Web Service From an Enterprise Bean
Using Annotations
Using Initial Context
31
Administrating an EJB Application
OC4J EJB JMX Support
Using Oracle Enterprise Manager 10
g
Application Server Control
Configuring EJB Logging
Logging Namespaces
Logging Levels
Configuring Logging With Application Server Control Logging MBean
Configuring Logging Using the j2ee-logging.xml File
Configuring Logging Using System Properties
Configuring TopLink Logging
Configuring Oracle JMS Connector Logging
Managing the Bean Instance Pool
Configuring Bean Instance Pool Size
Using Annotations
Using Deployment XML
Configuring Bean Instance Pool Timeouts for Session Beans
Using Annotations
Using Deployment XML
Configuring Bean Instance Pool Timeouts for Entity Beans
Using Deployment XML
Starting and Stopping an EJB Application
Troubleshooting an EJB Application
Validating XML Files
Debugging the ejb-jar.xml File
Debugging Generated Wrapper Code
Preserving Generated Wrapper Code in the Default Directory
Preserving Generated Wrapper Code in a Directory You Specify
Modifying Generated Wrapper Code
Disabling Generated Wrapper Code Preservation
32
Optimizing EJB Performance
Session Bean Performance
Bean Instance Pooling
Singleton Interceptors
JPA Entity Performance
Bean Instance Pooling
Fetch Type
Performance of an EJB 2.1 Entity Bean With Container-Managed Persistence
Bean Instance Pooling
Read-Only Entity Beans With Container-Managed Persistence
Performance of an EJB 2.1 Entity Bean With Bean-Managed Persistence
Read-Only Entity Beans With Bean-Managed Persistence
Commit Option A
Message-Driven Bean Performance
Bean Instance Pooling
Singleton Interceptors
A
XML Reference for orion-ejb-jar.xml Elements
OC4J and the orion-ejb-jar.xml File
TopLink Persistence Support
<orion-ejb-jar>
<enterprise-beans>
<persistence-manager>
<session-deployment>
Examples
<session-deployment> Attributes
<ior-security-config>
<env-entry-mapping>
<ejb-ref-mapping>
<resource-ref-mapping>
<resource-env-ref-mapping>
<message-destination-ref-mapping>
<entity-deployment>
Examples
<entity-deployment> Attributes
<ior-security-config>
<primkey-mapping>
<cmp-field-mapping>
<finder-method>
<env-entry-mapping>
<ejb-ref-mapping>
<service-ref-mapping>
<resource-ref-mapping>
<resource-env-ref-mapping>
<message-destination-ref-mapping>
<commit-option>
<message-driven-deployment>
Examples
<message-driven-deployment> Attributes
<env-entry-mapping>
<ejb-ref-mapping>
<resource-ref-mapping>
<resource-env-ref-mapping>
<message-destination-ref-mapping>
<config-property>
<assembly-descriptor>
Examples
<security-role-mapping>
<message-destination-mapping>
<default-method-access>
<method>
B
J2CA Activation Configuration Properties
Glossary
Index