BEA Logo BEA WebLogic Server Release 6.1

  BEA Home  |  Events  |  Solutions  |  Partners  |  Products  |  Services  |  Download  |  Developer Center  |  WebSUPPORT

 

  |  

  WebLogic Server Doc Home   |     Programming WebLogic EJB   |   Previous Topic   |   Next Topic   |   Contents   |   View as PDF

Programming WebLogic Enterprise JavaBeans

 

 

Introducing WebLogic Server Enterprise JavaBeans

Overview of Enterprise JavaBeans

EJB Components

Types of EJBs

Implementation of Preliminary Specifications

Preliminary J2EE Specification

Preliminary EJB 2.0 Specification

WebLogic Server EJB 2.0 Support

EJB Roles

Application Roles

Infrastructure Roles

Deployment and Management Roles

EJB Enhancements in WebLogic Server 6.1

Changed EJB Deployment Elements

Read-Only Multicast Invalidation Support

Automatic Generated Primary Key Support

Automatic Table Creation

Oracle SELECT HINTS

EJB Deployment Descriptor Editor

ejb-client.jar Support

BLOB and CLOB Support

Cascade Delete Support

Local Interface Support

Flushing the CMP Cache Support

Tuned CMP 1.1 Support

EJB Developer Tools

ANT Tasks to Create Skeleton Deployment Descriptors

EJB Deployment Descriptor Editor

XML Editor

 

Designing EJBs

Designing Session Beans

Designing Entity Beans

Entity Bean Home Interface

Make Entity EJBs Coarse-Grained

Encapsulate Additional Business Logic in Entity EJBs

Optimize Entity EJB Data Access

Designing Message-Driven Beans

Using WebLogic Server Generic Bean Templates

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

 

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 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

Specifying Message-Driven Beans as Durable Subscribers

Configuring Message-Driven Beans for Foreign JMS Providers

Reconnecting to a JMS Server or Foreign Service Provider

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

 

The WebLogic Server EJB Container and Supported Services

EJB Container

EJB Life Cycle

Entity EJB Life Cycle

Initializing Entity EJB Instances (Free Pool)

READY and ACTIVE Entity EJB Instances (Cache)

Entity EJB Life Cycle Transitions

Stateless Session EJB Life Cycle

Initializing Stateless Session EJB Instances

Activating and Pooling Stateless Session EJBs

Stateful Session EJB Life Cycle

Stateful Session EJB Creation

Stateful Session EJB Passivation

Concurrent Access to Stateful Session Beans

Comparing the Performance of Stateless Session Beans to BMP 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() (EJB 1.1 Only)

Warning for is-modified-method-name

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

Setting Entity EJBs to Read-Only

Read-Only Concurrency Strategy

Restrictions for Read-Only Concurrency Strategy

Read-Only Multicast Invalidation

Standard Read-Only Entity Beans

Read-Mostly Pattern

Read-Write Cache Strategy

EJBs in WebLogic Server Clusters

Clustered EJBHome 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 TRANSACTION_SERIALIZABLE

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

Delay-Database-Insert-Until

Resource Factories

Setting Up JDBC Datasource Factories

Setting Up URL Connection Factories

Locking Services for Entity EJBs

Exclusive Locking Services

Database Locking Services

Setting Up Database Locking

 

WebLogic Server Container-Managed Persistence Services

Overview of Container Managed Persistence Services

EJB Persistence Services

Using WebLogic Server RDBMS Persistence

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

Syntax

Operators

Operands

Examples of WLQL Expressions

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

SELECT DISTINCT

ORDERBY

Using Oracle SELECT HINTS

"get" and "set" Method Restrictions

BLOB and CLOB DBMS Column Support for the Oracle DBMS

Specifying a BLOB Using the Deployment Descriptor

Controlling Serialization of cmp-fields Mapped to OracleBlobs

Specifying a CLOB Using the Deployment Descriptors

Cascade Delete

Cascade Delete Method

Database Cascade Delete Method

Tuned EJB 1.1 CMP Updates in WebLogic Server

Flushing the CMP Cache

Primary Keys

Primary Key Mapped to a Single CMP Field

Primary Keys Class That Wraps Single or Multiple CMP Fields

Hints for Using Primary Keys

Mapping to a Database Column

Automatic Primary Key Generation for EJB 2.0 CMP

Valid Key Field Values

Specifying Primary Key Support for Oracle

Specifying Primary Key Support for Microsoft SQL Server

Specifying Primary Key Named Sequence Table Support

Automatic Table Creation

Container-Managed Relationships

Relationship Cardinality

Relationship Direction

Local Interfaces and Container-Managed Relationships

Using the Local Client

Changes to the Container for Local Interfaces

Defining Container-Managed Relationships

Specifying Relationship in ejb-jar.xml

Specifying Relationships in weblogic-cmp-jar.xml

Container-Managed Relationships and Caching

Groups

Specifying Field Groups

Java Data Types for CMP 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

Using the EJB Deployment Descriptor Editor

Setting WebLogic Server Deployment Mode

Using the Automatic Mode for Deployment

Automatically Deploying the EJB Examples

Using the Production Mode for Deployment

Packaging EJBs into a Deployment Directory

ejb.jar file

Compiling EJB Classes and Generating EJB Container Classes

Loading EJB Classes into WebLogic Server

Specifying an ejb-client.jar

Manifest Class-Path

 

Deploying EJBs to WebLogic Server

Roles and Responsibilities

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

Deploying Pinned EJBs - Special Step Required

Viewing Deployed EJBs

Undeploying Deployed EJBs

Undeploying EJBs

Updating Deployed EJBs

weblogic.deploy update and Targets

The Update Process

Updating the EJB

Deploying Compiled EJB Files

Deploying Uncompiled EJB Files

 

Configuring Security in EJBs

Configuring Security Constraints

 

WebLogic Server EJB Utilities

ejbc

ejbc Syntax

ejbc Arguments

ejbc Options

ejbc Examples

DDConverter

Conversion Options Available with DDConverter

Using DDConverter to Convert EJBs

DDConverter Syntax

DDConverter Arguments

DDConverter Options

DDConverter Examples

deploy

deploy Syntax

deploy Arguments

deploy Options

 

weblogic-ejb-jar.xml Document Type Definitions

EJB Deployment Descriptors

DOCTYPE Header Information

Document Type Definitions (DTDs) for Validation

weblogic-ejb-jar.xml

ejb-jar.xml

Changed EJB Deployment Elements in WebLogic Server 6.1

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

6.0 weblogic-ejb-jar.xml Deployment Descriptor Elements

allow-concurrent-calls

cache-type

connection-factory-jndi-name

concurrency-strategy

db-is-shared

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

entity-cache

entity-clustering

entity-descriptor

finders-load-bean

home-call-router-class-name

home-is-clusterable

home-load-algorithm

idle-timeout-seconds

initial-beans-in-free-pool

initial-context-factory

invalidation-target

is-modified-method-name

isolation-level

jms-client-id

jms-polling-interval-seconds

jndi-name

local-jndi-name

lifecycle

max-beans-in-cache

max-beans-in-free-pool

message-driven-descriptor

method

method-intf

method-name

method-param

method-params

passivation-strategy

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

run-as-identity-principal

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

trans-timeout-seconds

type-identifier

type-storage

type-version

weblogic-ejb-jar

weblogic-enterprise-bean

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

 

weblogic-cmp-rdbms-
jar.xml Document Type Definitions

EJB Deployment Descriptors

DOCTYPE Header Information

Document Type Definitions (DTDs) for Validation

weblogic-cmp-rdbms-jar.xml

ejb-jar.xml

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

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

automatic-key-generation

cmp-field

cmr-field

column-map

create-default-dbms-tables

data-source-name

db-cascade-delete

dbms-column

dbms-column-type

delay-database-insert-until

Example

ejb-name

enable-tuned-updates

field-group

field-map

foreign-key-column

generator-name

generator-type

group-name

include-updates

Function

key-cache-size

Example

key-column

max-elements

method-name

method-param

method-params

query-method

relation-name

relationship-role-name

sql-select-distinct

table-name

weblogic-ql

weblogic-query

weblogic-rdbms-relation

weblogic-relationship-role

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

5.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   next page