Programming WebLogic Enterprise JavaBeans

      

Introduction and Roadmap

Document Scope and Audience

Guide to this Document

Related Documentation

Samples and Tutorials for the EJB Developer

 

Avitek Medical Records Application (MedRec) and Tutorials

 

EJB Examples in the WebLogic Server Distribution

New and Changed Features in This Release

Understanding Enterprise JavaBeans

How Do Applications Use EJBs?

 

Session EJBs Implement Business Logic

 

Entity EJBs Maintain Persistent Data

 

Message-Driven Beans Implement Loosely Coupled Business Logic

EJB Anatomy and Environment

 

EJB Components

 

The EJB Container

 

EJB Deployment Descriptors

Bean and Resource References

Security Roles

EJBs, Clients, and Application Objects

 

EJB Communications

EJBs and Message Destination References

WebLogic Server Value-Added EJB Features

 

Performance-Enhancing Features for WebLogic Server EJBs

 

CMP Beans Increase Developer Productivity

 

Reliability and Availability Features

Securing EJBs

Designing Enterprise Java Beans

Choosing the Right Bean Type

 

Session Bean Features

 

Entity Bean Features

Use Read-Only Beans to Improve Performance If Stale Data Is Tolerable

Use Read-Write Beans for Higher Data Consistency

Combine Read-Only and Read-Write Beans to Optimize Performance

Use Session Facades to Optimize Performance for Remote Entity Beans

Avoid the Use of Transfer Objects

 

Message-Driven Bean Features

Persistence Management Alternatives

 

Use Container-Managed Persistence (CMP) for Productivity and Portability

 

Use Bean-Managed Persistence (BMP) Only When Necessary

Transaction Design and Management Options

 

Understanding Transaction Demarcation Strategies and Performance

Rollback

Transaction Boundaries

Distributing Transactions Across Beans

Costly Option: Distributing Transactions Across Databases

When to Use Bean-Managed Transactions

Keep Bean-Managed Transactions Short

 

Transaction Isolation: A Performance vs. Data Consistency Choice

Satisfying Application Requirements with WebLogic Server EJBs

Implementing Enterprise Java Beans

Overview of the EJB Development Process

Create a Source Directory

Create EJB Classes and Interfaces

 

Using WebLogic Server Generic Bean Templates

 

Programming Client Access to EJBs

Using EJB Links

 

Configuring EJBs to Send Requests to a URL

 

Configuring Network Communications for an EJB

 

Programming and Configuring Transactions

Calling multiple EJBs from a client's transaction context

Using an EJB “Wrapper” to Encapsulate a Cross-EJB Transaction

Programming the EJB Timer Service

 

Clustered Versus Local EJB Timer Services

Clustered EJB Timer Services

Local EJB Timer Services

 

Using Java Programming Interfaces to Program Timer Objects

 

Timer Deployment Descriptors

 

Configuring Clustered EJB Timers

Declare Web Service References

Compile Java Source

Generate Deployment Descriptors

Edit Deployment Descriptors

 

Security Elements

 

Resource Mapping Elements

 

Persistence Elements

 

Clustering Elements

 

Data Consistency Elements

 

Container-Managed Transactions Elements

 

Performance Elements

 

Network Communications Elements

Generate EJB Wrapper Classes, and Stub and Skeleton Files

 

appc and Generated Class Name Collisions

Package

 

Packaging Considerations for EJBs with Clients in Other Applications

Deploy

Solving Problems During Development

 

Adding Line Numbers to Class Files

 

Monitoring Data

 

Creating Debug Messages

WebLogic Server Tools for Developing EJBs

 

Administration Console

 

javac

 

EJBGen

 

weblogic.Deployer

 

appc

 

DDConverter

 

Comparison of EJB Tool Features

Session EJBs

Comparing Stateless and Stateful Session Beans

Pooling for Stateless Session EJBs

Caching and Passivating Stateful Session EJBs

 

Stateful Session EJB Creation

 

Stateful Session EJB Passivation

Eager Passivation (LRU)

Lazy Passivation (NRU)

 

Specifying the Persistent Store Directory for Passivated Beans

 

Configuring Concurrent Access to Stateful Session Beans

Design Decisions for Session Beans

 

Choosing Between Stateless and Stateful Beans

 

Choosing the Optimal Free Pool Setting for Stateless Session Beans

Implementing Session Beans

 

WebLogic-Specific Configurable Behaviors for Session Beans

Entity EJBs

Managing Entity Bean Pooling and Caching

 

Understanding Entity Pooling

 

Understanding Entity Caching

 

Understanding ejbLoad() and ejbStore() Behavior

 

Controlling the Behavior of ejbLoad() and ejbStore()

 

Disabling Cache Flushing

 

Configuring Application-Level Caching

Using Primary Keys

 

Specifying Primary Keys and Primary Key Classes

 

Guidelines for Primary Keys

 

Automatically Generating Primary Keys

 

String-Valued CMP Field Trimming

Configuring Entity EJBs for Database Operations

 

Configuring Table Mapping

 

Automatic Table Creation (Development Only)

 

Delaying Database Inserts

 

Limiting Database Reads with cache-between-transactions (Long-Term Caching)

 

Updating the Database Before Transaction Ends

 

Dynamic Queries

 

Enabling BLOB and CLOB Column Support for Oracle or DB2

 

Optimized CLOB Column Insertion on Oracle 10g

 

Specifying Field Groups

 

Ordering and Batching Operations

 

Using Query Caching (Read-Only Entity Beans)

Using SQL in Entity Beans

Using Container-Managed Relationships (CMRs)

 

CMR Requirements and Limitations

 

CMR Cardinality

 

CMR Direction

 

Removing CMRs

 

Defining Container-Managed Relationships (CMRs)

Specifying Relationship Cardinality

Specifying Relationship Directionality

One-to-One and One-to-Many Relationships

Many-to-Many Relationships

Specifying CMRs for EJBs that Map to Multiple Tables

 

Using Cascade Delete for Entities in CMRs

 

Relationship Caching

Choosing a Concurrency Strategy

 

Exclusive Concurrency

 

Database Concurrency

 

Optimistic Concurrency

 

Read Only Concurrency

 

Concurrency Strategy Trade-Offs

 

Configuring Concurrency Strategy

 

Using the Read-Mostly Pattern

 

Invalidating Entity EJBs Explicitly

CMP Entity Bean Descriptors Element by Feature

 

Container-Managed Relationship Elements

 

Primary Key Elements

Message-Driven EJBs

Message-Driven EJB Life Cycle and the Free Pool

 

MDBs and the Free Pool

 

MDBs and Concurrent Processing

MDBs and Messaging Models

 

Point-to-Point (Queue) Model: One Message Per Listener

 

Publish/Subscribe (Topic) Model

 

Exactly-Once Processing

JCA-Based MDBs

MDB Deployment Options

 

Destination and MDBs: Collocated vs. Not Collocated

 

JMS Distributed Destinations

Programming and Configuring MDBs: Main Steps

 

Required JMS Configuration

 

Create MDB Class and Configure Deployment Elements

Programming and Configuring MDBs: Details

 

Configuring EJBs to Use Logical Message Destinations

 

Configuring Destination Type

 

Configuring Transaction Management Strategy for an MDB

 

Configuring Suspension of Message Delivery During JMS Resource Outages

 

Configuring the Number of Seconds to Suspend a JMS Connection

Turning Off Suspension of a JMS Connection

 

Manually Suspending and Resuming Message Delivery

 

Configuring MDBs for Destinations

 

Configuring Durable Topic Subscriptions

 

Configuring Message Handling Behaviors

 

Using the Message-Driven Bean Context

 

Configuring a Security Identity for a Message-Driven Bean

 

Using MDBs With Cross Domain Security

Migration and Recovery for Clustered MDBs

Transaction Batching of MDBs

 

Configuring MDB Transaction Batching

 

How MDB Transaction Batching Works

Nutshell Summary: Deployment Elements for MDBs

Deployment Guidelines for Enterprise Java Beans

Before You Deploy an EJB

Understanding and Performing Deployment Tasks

Deployment Guidelines for EJBs

 

Deploy EJBs as Part of an Enterprise Application

 

Deploy EJBs That Call Each Other in the Same Application

 

Deploying EJBs that Use Dependency Injection

 

Deploy Homogeneously to a Cluster

 

Deploying Pinned EJBs to a Cluster

 

Redeploying an EJB

 

Redeploying an Individual EJB Implementation Class

 

Understanding Warning Messages

 

Disabling EJB Deployment Warning Messages

Deployment Descriptor Schema and Document Type Definitions Reference

XML Schema Definitions and Namespace Declarations

 

weblogic-ejb-jar.xml Namespace Declaration and Schema Location

 

weblogic-cmp-jar.xml Namespace Declaration and Schema Location

 

ejb-jar.xml Namespace Declaration and Schema Location

Document Type Definitions and DOCTYPE Header Information

weblogic-ejb-jar.xml Deployment Descriptor Reference

2.1 weblogic-ejb-jar.xml File Structure

2.1 weblogic-ejb-jar.xml Elements

weblogic-cmp-jar.xml Deployment Descriptor Reference

2.1 weblogic-cmp-jar.xml Deployment Descriptor File Structure

2.1 weblogic-cmp-jar.xml Deployment Descriptor Elements

 

Setting up Oracle for Cascade Delete

appc Reference

appc

 

Advantages of Using appc

 

appc Syntax

 

Designating Alternative Deployment Descriptors

 

appc Options

 

appc and EJBs

EJBGen Reference

Running EJBGen

 

EJBGen Distribution and Examples

 

Invoking EJBGen

 

Using Key EJBGen Features

Examples of EJBGen Tag Usage

 

Mapping an Entity Bean to Several Tables with EJBGen

 

Specifying Relationship Caching with EJBGen Tags

 

Specifying Relationships with EJBGen Tags

Enum Attribute Constant Values

 

Constants.Bool

 

Constants.TransactionAttribute

 

Constants.IsolationLevel

 

Constants.RefType

 

Constants.HomeLoadAlgorithm

 

Constants.Interface

 

Constants.ConcurrencyStrategy

EJBGen Annotation Reference

EJB Container Annotations

 

weblogic.ejbgen.ActivationConfigProperties

 

weblogic.ejbgen.ActivationConfigProperty

 

weblogic.ejbgen.AutomaticKeyGeneration

 

weblogic.ejbgen.CmpField

 

weblogic.ejbgen.CmrField

 

weblogic.ejbgen.Compatibility

 

weblogic.ejbgen.CreateDefaultDbmsTables

 

weblogic.ejbgen.CreateDefaultRdbmsTables

 

weblogic.ejbgen.DBSpecificSQL

 

weblogic.ejbgen.EjbClientJar

 

weblogic.ejbgen.EjbInterface (deprecated)

 

weblogic.ejbgen.EjbLocalRef

 

weblogic.ejbgen.EjbLocalRefs

 

weblogic.ejbgen.EjbRef

 

weblogic.ejbgen.EjbRefs

 

weblogic.ejbgen.Entity

 

weblogic.ejbgen.EntityCacheRef

 

weblogic.ejbgen.EnvEntries

 

weblogic.ejbgen.EnvEntry

 

weblogic.ejbgen.FileGeneration

 

weblogic.ejbgen.Finder

 

weblogic.ejbgen.Finders

 

weblogic.ejbgen.ForeignJmsProvider

 

weblogic.ejbgen.JarSettings

 

weblogic.ejbgen.JndiName

 

weblogic.ejbgen.LocalHomeMethod

 

weblogic.ejbgen.LocalMethod

 

weblogic.ejbgen.MessageDestination

 

weblogic.ejbgen.MessageDestinationRef

 

weblogic.ejbgen.MessageDestinationRefs

 

weblogic.ejbgen.MessageDestinations

 

weblogic.ejbgen.MessageDriven

 

weblogic.ejbgen.MethodIsolationLevelPattern

 

weblogic.ejbgen.MethodIsolationLevelPatterns

 

weblogic.ejbgen.MethodPermissionPattern

 

weblogic.ejbgen.MethodPermissionPatterns

 

weblogic.ejbgen.PrimKeyField

 

weblogic.ejbgen.Relation

 

weblogic.ejbgen.Relations

 

weblogic.ejbgen.RelationshipCachingElement

 

weblogic.ejbgen.RelationshipCachingElements

 

weblogic.ejbgen.RemoteHomeMethod

 

weblogic.ejbgen.RemoteMethod

 

weblogic.ejbgen.ResourceEnvRef

 

weblogic.ejbgen.ResourceEnvRefs

 

weblogic.ejbgen.ResourceRef

 

weblogic.ejbgen.ResourceRefs

 

weblogic.ejbgen.RoleMapping

 

weblogic.ejbgen.RoleMappings

 

weblogic.ejbgen.SecurityRoleRef

 

weblogic.ejbgen.SecurityRoleRefs

 

weblogic.ejbgen.Select

 

weblogic.ejbgen.ServiceEndpointMethod

 

weblogic.ejbgen.ServiceRef

 

weblogic.ejbgen.ServiceRefs

 

weblogic.ejbgen.Session

 

weblogic.ejbgen.SqlFinder

 

weblogic.ejbgen.SqlFinders

 

weblogic.ejbgen.SqlShape

 

weblogic.ejbgen.SqlShapeTable

 

weblogic.ejbgen.SqlShapes

 

weblogic.ejbgen.ValueObject

 

weblogic.ejbgen.ValueObjectField

EJB Query Language (EJB-QL) and WebLogic Server

EJB QL Requirement for EJB 2.x Beans

Using the EJB 2.x WebLogic QL Extension for EJB QL

 

upper and lower Functions

 

Using ORDER BY

 

Using Subqueries

DISTINCT Clause with Subqueries

 

Using Arithmetic Functions

 

Using Aggregate Functions

 

Using Queries that Return ResultSets

 

Using Oracle SELECT HINTS

 

“get” and “set” Method Restrictions

Properties-Based Methods of the Query Interface

Migrating from WLQL to EJB QL

Known Issue with Implied Cross Products

EJB QL Error-Reporting

 

Visual Indicator of Error in Query

 

Multiple Errors Reported after a Single Compilation

Important Information for EJB 1.1 Users

Writing for RDBMS Persistence for EJB 1.1 CMP

 

Finder Signature

 

finder-list Element

 

finder-query Element

Using WebLogic Query Language (WLQL) for EJB 1.1 CMP

 

WLQL Syntax

 

WLQL Operators

 

WLQL Operands

 

Examples of WLQL Expressions

Using SQL for CMP 1.1 Finder Queries

Tuned EJB 1.1 CMP Updates in WebLogic Server

Using is-modified-method-name to Limit Calls to ejbStore()

5.1 weblogic-ejb-jar.xml Deployment Descriptor File Structure

5.1 weblogic-ejb-jar.xml Deployment Descriptor Elements

 

caching-descriptor

 

persistence-descriptor

 

clustering-descriptor

 

transaction-descriptor

 

reference-descriptor

 

transaction-isolation

 

security-role-assignment

1.1 weblogic-cmp-jar.xml Deployment Descriptor File Structure

1.1 weblogic-cmp-jar.xml Deployment Descriptor Elements

 

RDBMS Definition Elements

 

EJB Field-Mapping Elements

 

Finder Elements


  Back to Top       Previous