bea.com | products | dev2dev | support | askBEA
 Download Docs   Site Map   Glossary 
Search

Programming WebLogic Enterprise JavaBeans

 Previous Next Contents Index View as PDF  

Overview of WebLogic Server Enterprise JavaBeans (EJBs)

What Are EJBs?

Types of EJBs

EJB Components

The EJB Container

Creating EJBs: Main Steps

EJB Developer Tools

ANT Tasks to Create Skeleton Deployment Descriptors

WebLogic Builder

EJBGen

DDInit

weblogic.Deployer

XML Editor

Implementation of Java Specifications

EJB Features and Changes in this Release

Performance Monitoring Improvements

appc

Batch Operations

Automatic Database Detection

EJB QL Compiler Enhancements

Performance Improvements

Reloadable EJB Modules

EJB Deployment Assistants

New dbms-column-type Values

sql-select-distinct Deprecated

ejbc Deprecated

Designing Session and Entity EJBs

Designing Session Beans

Session Facade Pattern

Designing Entity Beans

Entity Bean Home Interface

Make Entity EJBs Coarse-Grained

Encapsulate Additional Business Logic in Entity EJBs

Optimize Entity EJB Data Access

Using Inheritance with EJBs

Accessing Deployed EJBs

Differences Between Accessing EJBs from Local Clients and Remote Clients

Restrictions on Concurrency Access of EJB Instances

Storing EJB References in Home Handles

Using Home Handles Across a Firewall

Preserving Transaction Resources

Allowing the Datastore to Manage Transactions

Using Container-Managed Transactions Instead of Bean-Managed Transactions for EJBs

Never Demarcate Transactions from Application

Always Use A Transactional Datasource for Container-Managed EJBs

Designing 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 Processing for Topics and Queues

Developing and Configuring Message-Driven Beans

Message-Driven Bean Class Requirements

Using the Message-Driven Bean Context

Implementing Business Logic with onMessage()

Specifying Principals and Setting Permissions for JMS Destinations

Handling Exceptions

Invoking a Message-Driven Bean

Creating and Removing Bean Instances

Deploying Message-Driven Beans in WebLogic Server

Using Transaction Services with Message-Driven Beans

Message Receipts

Message Acknowledgment

Message-Driven Bean Migratable Service

Enabling the Message-Driven Bean Migratable Service

Migrating Message-Driven Beans

The WebLogic Server EJB Container and Supported Services

EJB Container

EJB Lifecycle in WebLogic Server

Stateless Session EJB Life Cycle

Initializing Stateless Session EJB Instances

Activating and Pooling Stateless Session EJBs

Stateful Session EJB Life Cycle

Activating and Using Stateful Session EJB Instances

Passivating Stateful Session EJBs

Removing Stateful Session EJB Instances

Stateful Session EJB Requirements

Using max-beans-in-free-pool

Special Use of max-beans-in-free-pool

EJBs in WebLogic Server Clusters

Clustered EJB Home Objects

Clustered EJBObjects

Session EJBs in a Cluster

Stateless Session EJBs

Stateful Session EJBs

In-Memory Replication for Stateful Session EJBs

Requirements and Configuration for In-Memory Replication

Limitations of In-Memory Replication

Entity EJBs in a Cluster

Read-Write Entity EJBs in a Cluster

Cluster Address

Transaction Management

Transaction Management Responsibilities

Using javax.transaction.UserTransaction

Restriction for Container-Managed EJBs

Transaction Isolation Levels

Setting User Transaction Isolation Levels

Setting Container-Managed Transaction Isolation Levels

Limitations of TransactionSerializable

Special Note for Oracle Databases

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

Database Insert Support

Delay-Database-Insert-Until

Batch Operations

Database Operation Ordering

Batch Operations Guidelines and Limitations

Resource Factories

Setting Up JDBC Data Source Factories

Setting Up URL Connection Factories

Using EJB Links

WebLogic Server Container-Managed Persistence Service - Basic Features

Overview of Container Managed Persistence Service

EJB Persistence Services

Using WebLogic Server RDBMS Persistence

Using Primary Keys

Primary Key Mapped to a Single CMP Field

Primary Key Class That Wraps Single or Multiple CMP Fields

Anonymous Primary Key Class

Hints for Using Primary Keys

Mapping to a Database Column

Container-Managed Persistence Relationships

One-to-One Relationships

One-to-Many Relationships

Many-to-Many Relationships

Unidirectional Relationships

Bidirectional Relationships

Removing Beans in Relationships

Local Interfaces

Using the Local Client

Changes to the Container for Local Interfaces

Using EJB QL for EJB 2.0

EJB QL Requirement for EJB 2.0 Beans

Migrating from WLQL to EJB QL

Using EJB 2.0 WebLogic QL Extension for EJB QL

Using SELECT DISTINCT

Using ORDERBY

Using SubQueries

Using Aggregate Functions

Using Queries that Return ResultSets

EJB QL Error-Reporting Enhancements

Visual Indicator of Error in Query

Multiple Errors Reported after a Single Compilation

Using Dynamic Queries

Enabling Dynamic Queries

Executing Dynamic Queries

BLOB and CLOB DBMS Column Support for the Oracle DBMS

Specifying a BLOB Using the Deployment Descriptor

Specifying a CLOB Using the Deployment Descriptors

Cascade Delete

Cascade Delete Method

Database Cascade Delete Method

Flushing the CMP Cache

Java Data Types for CMP Fields

EJB Concurrency Strategy

Concurrency Strategy for Read-Write EJBs

Specifying the Concurrency Strategy

Exclusive Concurrency Strategy

Database Concurrency Strategy

Optimistic Concurrency Strategy

ReadOnly Concurrency Strategy

Read-Only Entity Beans

Restrictions for ReadOnly Concurrency Strategy

Automatic Database Detection

Enabling Automatic Database Detection

Behavior When Type Conflict Detected

WebLogic Server Container-Managed Persistence Service - Advanced Features

Read-Only Multicast Invalidation

Read-Mostly Pattern

Relationship Caching with Entity Beans

Specifying Relationship Caching

Enabling Relationship Caching

Relationship Caching Limitations

Combined Caching with Entity Beans

Caching Between Transactions

Caching Between Transactions with Exclusive Concurrency

Caching Between Transactions with ReadOnly Concurrency

Caching Between Transactions with Optimistic Concurrency

Enabling Caching Between Transactions

Using cache-between-transactions to Limit Calls to ejbLoad()

Restrictions and Warnings for cache-between-transactions

ejbLoad() and ejbStore() Behavior for Entity EJBs

Warning for is-modified-method-name

Using delay-updates-until-end-of-tx to Change ejbStore() Behavior

Groups

Specifying Field Groups

Using Groups

Automatic Primary Key Generation

Valid Key Field Types

Specifying Primary Key Support for Oracle

Specifying Primary Key Support for Microsoft SQL Server

Specifying Primary Key Named Sequence Table Support

Automatic Table Creation

Automatic Database Detection

Enabling Automatic Database Detection

Behavior When Type Conflict Detected

Using Oracle SELECT HINTS

Multiple Table Mapping

Multiple Table Mappings for cmp-fields

Multiple Table Mappings for cmr-fields

Packaging EJBs for the WebLogic Server Container

Required Steps for Packaging EJBs

Reviewing the EJB Source File Components

WebLogic Server EJB Deployment Files

ejb-jar.xml

weblogic-ejb-jar.xml

weblogic-cmp-rdbms.xml

Relationships Among the Deployment Files

Specifying and Editing the EJB Deployment Descriptors

Creating the Deployment Files

Manually Editing EJB Deployment Descriptors

Referencing Other EJBs and Resources

Referencing External EJBs

Referencing Application-Scoped EJBs

Referencing Application-Scoped JDBC DataSources

Packaging EJBs into a Deployment Directory

ejb.jar file

Compiling EJB Classes and Generating EJB Container Classes

Possible Generated Class Name Collisions

Loading EJB Classes into WebLogic Server

Specifying an ejb-client.jar

Manifest Class-Path

Deploying EJBs to WebLogic Server

Deploying EJBs at WebLogic Server Startup

Deploying EJBs in Different Applications

Deploying EJBs on a Running WebLogic Server

EJB Deployment Names

Deploying New EJBs into a Running Environment

Viewing Deployed EJBs

Undeploying Deployed EJBs

Undeploying EJBs

Updating Deployed EJBs

The Update Process

Updating the EJB

Deploying Compiled EJB Files

Deploying Uncompiled EJB Files

EJB Runtime Monitoring

Runtime Cache Attributes

Cached Beans Current Count

Cache Access Count

Cache Hit Count

Cache Miss Count

Activation Count

Passivation Count

Cache Miss Ratio

Runtime Lock Manager Attributes

Lock Entries Current Count

Lock Manager Access Count

Waiter Total Count

Timeout Total Count

Lock Waiter Ratio

Lock Timeout Ratio

Runtime Free Pool Attributes

Access Total Count

Miss Total Count

Destroyed Total Count

Pooled Beans Current Count

Beans In Use Current Count

Waiter Current Count

Pool Timeout Total Count

Pool Miss Ratio

Destroyed Bean Ratio

Pool Timeout Ratio

Runtime Transaction Attributes

Transactions Committed Total Count

Transactions Rolled Back Total Count

Transactions Timed Out Total Count

Transaction Rollback Ratio

Transaction Timeout Ratio

JMS Attributes

JMSConnection Alive

WebLogic Server EJB Tools

Ant Tasks

appc

appc Syntax

appc Options

appc Ant Task

appc and EJBs

Advantages of Using appc

Builder

DDConverter

Conversion Options Available with DDConverter

Using DDConverter to Convert EJBs

DDConverter Syntax

DDConverter Arguments

DDConverter Options

DDConverter Examples

DDInit

DDInit Ant Tasks

Deployer

EJBGen

EJBGen Syntax

EJBGen Example

EJBGen Tags

@ejbgen:automatic-key-generation

@ejbgen:cmp-field

@ejbgen:cmr-field

@ejbgen:create-default-rdbms-tables

@ejbgen:ejb-client-jar

@ejbgen:ejb-local-ref

@ejbgen:ejb-ref

@ejbgen:entity

@ejbgen:env-entry

@ejbgen:finder

@ejbgen:jndi-name

@ejbgen:local-home-method

@ejbgen:local-method

@ejbgen:message-driven

@ejbgen:primkey-field

@ejbgen:relation

@ejbgen:remote-home-method

@ejbgen:remote-method

@ejbgen:resource-env-ref

@ejbgen:resource-ref

@ejbgen:role-mapping

@ejbgen:select

@ejbgen:session

@ejbgen:value-object

ejbc

Advantages of Using ejbc

ejbc Syntax

ejbc Arguments

ejbc Options

ejbc Examples

The weblogic-ejb-jar.xml Deployment Descriptor

EJB Deployment Descriptors

DOCTYPE Header Information

Document Type Definitions (DTDs) for Validation

weblogic-ejb-jar.xml

ejb-jar.xml

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

2.0 weblogic-ejb-jar.xml Deployment Descriptor Elements

allow-concurrent-calls

cache-between-transactions

cache-type

client-authentication

client-cert-authentication

clients-on-same-server

concurrency-strategy

confidentiality

connection-factory-jndi-name

delay-updates-until-end-of-tx

description

destination-jndi-name

ejb-name

ejb-reference-description

ejb-ref-name

Example

ejb-local-reference-description

enable-call-by-reference

enable-dynamic-queries

entity-cache

entity-cache-name

entity-cache-ref

entity-clustering

entity-descriptor

estimated-bean-size

finders-load-bean

home-call-router-class-name

home-is-clusterable

home-load-algorithm

idempotent-methods

identity-assertion

idle-timeout-seconds

iiop-security-descriptor

initial-beans-in-free-pool

initial-context-factory

integrity

invalidation-target

is-modified-method-name

isolation-level

jms-polling-interval-seconds

jms-client-id

jndi-name

local-jndi-name

max-beans-in-cache

max-beans-in-free-pool

message-driven-descriptor

method

method-intf

method-name

method-param

method-params

persistence

persistence-type

persistence-use

persistent-store-dir

pool

principal-name

provider-url

read-timeout-seconds

reference-descriptor

relationship-description

replication-type

res-env-ref-name

res-ref-name

resource-description

resource-env-description

role-name

security-permission

security-permission-spec

security-role-assignment

stateful-session-cache

stateful-session-clustering

stateful-session-descriptor

stateless-bean-call-router-class-name

stateless-bean-is-clusterable

stateless-bean-load-algorithm

stateless-bean-methods-are-idempotent

stateless-clustering

stateless-session-descriptor

transaction-descriptor

transaction-isolation

transport-requirements

trans-timeout-seconds

type-identifier

type-storage

type-version

weblogic-ejb-jar

weblogic-enterprise-bean

The weblogic-cmp-rdbms-
jar.xml Deployment Descriptor

EJB Deployment Descriptors

DOCTYPE Header Information

Document Type Definitions (DTDs) for Validation

weblogic-cmp-rdbms-jar.xml

ejb-jar.xml

2.0 weblogic-cmp-rdbms-jar.xml Deployment Descriptor File Structure

2.0 weblogic-cmp-rdbms-jar.xml Deployment Descriptor Elements

automatic-key-generation

caching-element

caching-name

check-exists-on-method

cmp-field

cmr-field

column-map

create-default-dbms-tables

database-type

data-source-name

db-cascade-delete

dbms-column

dbms-column-type

description

delay-database-insert-until

Example

ejb-name

enable-batch-operations

enable-tuned-updates

field-group

field-map

foreign-key-column

foreign-key-table

generator-name

generator-type

group-name

include-updates

Function

key-cache-size

Example

key-column

max-elements

method-name

method-param

method-params

optimistic-column

order-database-operations

primary-key-table

query-method

relation-name

relationship-caching

relationship-role-map

relationship-role-name

sql-select-distinct

table-map

table-name

use-select-for-update

validate-db-schema-with

verify-columns

weblogic-ql

weblogic-query

weblogic-rdbms-bean

weblogic-rdbms-jar

weblogic-rdbms-relation

weblogic-relationship-role

Important Information for EJB 1.1 Users

Writing for RDBMS Persistence for EJB 1.1 CMP

Finder Signature

finder-list Stanza

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

max-beans-in-free-pool

initial-beans-in-free-pool

max-beans-in-cache

idle-timeout-seconds

cache-strategy

read-timeout-seconds

persistence-descriptor

is-modified-method-name

delay-updates-until-end-of-tx

persistence-type

db-is-shared

stateful-session-persistent-store-dir

persistence-use

clustering-descriptor

home-is-clusterable

home-load-algorithm

home-call-router-class-name

stateless-bean-is-clusterable

stateless-bean-load-algorithm

stateless-bean-call-router-class-name

stateless-bean-methods-are-idempotent

transaction-descriptor

trans-timeout-seconds

reference-descriptor

resource-description

ejb-reference-description

enable-call-by-reference

jndi-name

transaction-isolation

isolation-level

method

security-role-assignment

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

1.1 weblogic-cmp-rdbms-jar.xml Deployment Descriptor Elements

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

 

Back to Top Previous Next