Programming WebLogic Enterprise JavaBeans
Contents
1. EJB Features and Changes in WebLogic Server
Implementation of Nonfinal Specification
EJB 2.0 Upgrade for WebLogic Server
EJB 2.0 Features
Supported Features
Features in Development
Major EJB Changes in This Release
Message-Driven Bean Support
Container-Managed Persistence
EJB QL
Application Assembly Support in Deploying EJBs
.jar, .ear, and Directory Deployment Units
Unsupported Deployment Utilities
DDConverter Upgrade Utility
2. WebLogic Server EJB Design and Development
Invoking Deployed EJBs
Accessing EJBs from either Local or Remote Clients
Restrictions on Accessing EJB Instances
Storing EJB References in Home Handles
Using Home Handles Across a Firewall
EJB Design Tips
Preserve Transaction Resources
Allow the Datastore to Manage Transactions
Using Container-Managed Transactions Instead of Bean-Managed Transactions
Never Demarcate Transactions from Application
Use Correct Modeling for Entity EJBs
Entity EJBs Should Be Coarse-Grained
Entity EJBs Should Contain Business Logic
Optimize Entity EJB Data Access
Use isModified() Where Appropriate
Using Inheritance with EJBs
Using Session Beans
3. Using Message-Driven Beans
What Are Message-Driven Beans?
Differences Between Message-Driven Beans and Standard JMS Consumers
Differences Between Message-Driven Beans and Stateless Session EJBs
Concurrent Support for Message-Driven Beans
Invoking a Message-Driven Bean
Developing Message-Driven Beans
Bean Class Requirements
Creating and Removing Bean Instances
Using the Message-Driven Bean Context
Implementing Business Logic with onMessage()
Handling Exceptions
Transaction Services for Message-Driven Beans
Message Receipts
Message Acknowledgment
Deploying Message-Driven Beans in WebLogic Server
Deployment Descriptors
Deployment Elements
4. The WebLogic Server EJB Container
EJB Life Cycle in WebLogic Server
Stateless Session EJB Life Cycle
Initializing EJB Instances
Activating and Pooling EJBs
Stateful EJB Life Cycle
Initializing and Using EJB Instances
Passivating Stateful EJBs
Removing Stateful Session EJB Instances
Using max-beans-in-free-pool
Stateful Session EJB Requirements
Special Use of max-beans-in-free pool
Locking Model for Entity EJBs
ejbLoad() and ejbStore() Behavior for Entity EJBs
Using db-is-shared to Limit Calls to ejbLoad()
Restrictions and Warnings for db-is-shared
Using is-modified-method-name to Limit Calls to ejbStore()
Warning for is-modified-method-name
Using delay-updates-until-end-of-tx to Change ejbStore() Behavior
Setting the Entity EJBs to Read-Only
Read-Write Cache Strategy
Read-Only-Cache-Strategy
Restrictions for Read-Only EJBs
Read-Mostly Pattern
EJBs in WebLogic Server Clusters
Overview
Clustered EJBHome Objects
Clustered EJBObjects
Session EJBs in a Cluster
Stateless Session EJBs
Stateful Session EJBs
Entity EJBs in a Cluster
Read-Write Entity EJBs
Non-Transactional Datastores
Transaction Management
Transaction Management Responsibilities
Using javax.transaction.UserTransaction
Restriction for Container-Managed EJBs
Distributing Transactions Across Multiple EJBs
Calling Multiple EJBs from a Single Transaction Context
Encapsulating a Multi-Operation Transaction
Distributing Transactions Across EJBs in a WebLogic Server Cluster
Transaction Isolation Level
Limitations of TRANSACTION_SERIALIZABLE
Special Note for Oracle Databases
Resource Factories
Setting Up JDBC Datasource Factories
Setting up URL Connection Factories
Persistence Services
Using WebLogic Server RDBMS Persistence
Writing Finders for RDBMS Persistence
Finder Signature
finder-list Stanza
finder-query Element
Using WebLogic Query Language (WLQL)
Syntax
Operators
Operands
Examples of WLQL Expressions
Using Java Expressions in WLQL
Example of Finder Method Signatures
Restrictions
Locking and Caching Services for Entity EJBs
Pessimistic Locking Services
Database Locking Services
Setting Up Database Locking
In-Memory Replication for Stateful Session EJBs
Requirements and Configuration
Limitations of In-Memory Replication
Home Method Support for Entity EJBs
5. WebLogic Server Container-Managed Persistence Services
EJB 2.0 Persistence Features and Changes
"get" and "set" Method Restrictions
BLOB and CLOB DBMS Column Restrictions
EJB QL Requirement for EJB 2.0 Beans
isModified() Not Required for CMP Beans
Using EJB QL
Basic EJB QL Syntax
EJB QL String Literals
EJB QL Operators
Finder Methods
Finder Parameter Placeholders
Select Methods
EJB QL Conditional Expressions
EJB QL Examples
Migrating from (EJB 1.1) WLQL to (EJB 2.0) EJB QL
Using WebLogic Query Language Extension
ORDERBY
Container-Managed Relationships
One-to-One Relationships
One-to-Many Relationships
Many-to-Many Relationships
Unidirectional Relationships
Bidirectional Relationships
Primary Keys
Foreign Keys
Groups
Specifying Field Groups
Using Groups
Supported Data Types
6. Deploying EJBs to WebLogic Server
Required Steps for Deploying EJBs
Setting Deployment Properties
Generating EJB Container Classes
Loading EJB Classes into WebLogic Server
Deploying EJBs at WebLogic Server Startup
Deploying EJBs in Different Applications
Deploying EJBs in a Running WebLogic Server (Dynamic Deployment)
EJB Deployment Names
Viewing Deployed EJBs
Deploying New EJBs into a Running Environment
Undeploying Deployed EJBs
Undeploying EJBs
Updating Deployed EJBs
The Update Process
Updating the EJB
7. Deploying EJBs in the EJB Container
Roles and Responsibilities
WebLogic Server Deployment Files
Automatic Deployment Directory
Deploying Compiled EJB .jar Files
Deploying Uncompiled EJB .jar Files
Deploying from an EJB .jar Directory
8. WebLogic Server EJB Utilities
ejbc
Syntax
Arguments
Options
Examples
DDConverter
Converting EJBs for Use in WebLogic Server 6.0
Converting EJB CMP 1.1 Beans to EJB CMP 2.0 Beans
Converting CMP Beans between WebLogic Server Versions
Syntax
Arguments
Options
Examples
deploy
Syntax
Arguments
Options
9. WebLogic Server 6.0 EJB Deployment Properties
Manually Editing XML Deployment Files
DOCTYPE Header Information
Document Type Definitions (DTDs) for Validation
weblogic-ejb-jar.xml Deployment Descriptor File
Index of weblogic-ejb-jar Deployment Elements
allow-concurrent-calls
Function
Example
concurrency-strategy
Function
Example
db-is-shared
Function
Example
delay-updates-until-end-of-tx
Function
Example
description
Function
Example
destination-jndi-name
Function
Example
ejb-name
Function
Example
ejb-reference-description
Function
Example
ejb-ref-name
Function
Example
enable-call-by-reference
Function
Example
entity-cache
Function
Example
entity-clustering
Function
Example
entity-descriptor
Function
Example
finders-load-bean
Function
Example
home-call-router-class-name
Function
Example
home-is-clusterable
Function
Example
home-load-algorithm
Function
Example
idle-timeout-seconds
Function
Example
initial-beans-in-free-pool
Function
Example
is-modified-method-name
Function
Example
isolation-level
Function
Example
jndi-name
Function
Example
lifecycle
Function
Example
max-beans-in-cache
Function
Example
max-beans-in-free-pool
Function
Example
message-driven-descriptor
Function
Example
method
Function
Example
method-intf
Function
Example
method-name
Function
Example
method-param
Function
Example
method-params
Function
Example
passivation-strategy
Function
Example
persistence
Function
Example
persistence-type
Function
Example
persistence-use
Function
Example
persistent-store-dir
Function
Example
pool
Function
Example
principal-name
Function
Example
read-timeout-seconds
Function
Example
reference-descriptor
Function
Example
replication-type
Function
Example
res-env-ref-name
Function
Example
res-ref-name
Function
Example
resource-env-description
Function
Example
resource-description
Function
Example
role-name
Function
Example
run-as-identity-principal
Function
Example
security-role-assignment
Function
Example
stateful-session-cache
Function
Example
stateful-session-clustering
Function
Example
stateful-session-descriptor
Function
Example
stateless-bean-call-router-class-name
Function
Example
stateless-bean-is-clusterable
Function
Example
stateless-bean-load-algorithm
Function
Example
stateless-bean-methods-are-idempotent
Function
Example
stateless-clustering
Function
Example
stateless-session-descriptor
Function
Example
transaction-descriptor
Function
Example
transaction-isolation
Function
Example
trans-timeout-seconds
Function
Example
type-identifier
Function
Example
type-storage
Function
Example
type-version
Function
Example
weblogic-cmp-rdbms-jar.xml Deployment Descriptor File
Index of weblogic-cmp-rdbms-jar.xml Deployment Elements
cmp-field
Function
Example
cmr-field
Function
Example
column-map
Function
Example
data-source-name
Function
Example
dbms-column
Function
Example
ejb-name
Function
Example
field-group
Function
Example
field-map
Function
Example
foreign-key-column
Function
Example
group-name
Function
Example
key-column
Function
Example
max-elements
Function
Example
method-name
Function
Example
method-param
Function
Example
method-params
Function
Example
query-method
Function
Example
relation-name
Function
Example
relationship-role-name
Function
Example
table-name
Function
Example
weblogic-ql
Function
Example
weblogic-query
Function
Example
weblogic-relationship-role
Function
Example
10. WebLogic Server 5.1 EJB Deployment Properties
Manually Editing XML Deployment Files
Basic Conventions
DOCTYPE Header Information
Document Type Definitions (DTDs) for Validation
weblogic-ejb-jar.xml Deployment Descriptor File
Caching Properties
caching-descriptor
Persistence Properties
persistence-descriptor
Clustering Properties
clustering-descriptor
Transaction Properties
transaction-descriptor
EJB References
reference-descriptor
Isolation Level Settings
transaction-isolation
isolation-level
method
Security Role Assignments
security-role-assignment
enable-call-by-reference
weblogic-cmp-rdbms-jar.xml Deployment Descriptor File
RDBMS Definition Elements
pool-name
schema-name
table-name
EJB Field-Mapping Elements
attribute-map
object-link
bean-field
dbms-column
Finder Elements
finder-list
finder
method-name
method-params
method-param
finder-query
finder-expression
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
Required browser: Netscape 4.0 or higher, or Microsoft Internet Explorer 4.0 or higher.
|