Programming WebLogic Enterprise JavaBeans

 Previous Next Contents Index View as PDF  

Introducing WebLogic Server Enterprise JavaBeans

Overview of Enterprise JavaBeans

EJB Components

Types of EJBs

Implementation of Java Specifications

J2EE Specification

EJB 2.0 Specification

Securing WebLogic Server EJB Resources

WebLogic Server EJB 2.0 Support

EJB Roles

Application Roles

Infrastructure Roles

Deployment and Management Roles

EJB Enhancements in WebLogic Server 7.0

Changed Deployment Elements in WebLogic Server 7.0

Dynamic Query Support

Message-Driven Bean Migratable Service Support

EJB CMP Multiple Table Mapping Support

EJB WebLogic QL Enhancements Support

Optimistic Concurrency Support

ReadOnly Entity Concurrency Support

Combined Caching Support

Relationship Caching Support

EJB Links Support

Bulk Insert Support

EJB Developer Tools

ANT Tasks to Create Skeleton Deployment Descriptors

WebLogic Builder

EJBGen

weblogic.Deployer

WebLogic 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

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

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

Configuring Message-Driven Beans for
non-BEA JMS Providers

Specifying an MDB as Transactional

Specifying an MDB as Non-Transactional

Reconnecting to a JMS Server or Non-BEA Service Provider

Configuring an MDB to Listen on a JMS Distributed Destination

Configuring a Security Identity for a Message-Driven Bean

The WebLogic Server EJB Container and Supported Services

EJB Container

EJB Life Cycle

Entity Bean Lifecycle and Caching and Pooling

Initializing Entity EJB Instances (Free Pool)

READY and ACTIVE Entity EJB Instances (Cache)

Removing Beans from Cache

Entity EJB Lifecycle 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

Controlling Passivation

Concurrent Access to Stateful Session Beans

ejbLoad() and ejbStore() Behavior for Entity EJBs

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

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 and ReadOnly Concurrency

Restrictions for ReadOnly Concurrency Strategy

Read-Only Multicast Invalidation

Read-Mostly Pattern

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 for cache-between-transactions

EJBs in WebLogic Server Clusters

Clustered Homes and EJBObjects

Clustered EJB Home Objects

Clustered EJBObjects

Clustering Support for Different Types of EJBs

Stateless Session EJBs in a Cluster

Stateful Session EJBs in a Cluster

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 Bean-Managed Transaction Isolation Levels

Setting Container-Managed Transaction Isolation Levels

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

Bulk Insert

Resource Factories

Setting Up JDBC Data Source Factories

Setting Up URL Connection Factories

WebLogic Server Container-Managed Persistence Service

Overview of Container Managed Persistence Service

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

WLQL Syntax

WLQL Operators

WLQL Operands

Examples of WLQL Expressions

Using SQL for CMP 1.1 Finder Queries

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

upper and lower Functions

Using SELECT DISTINCT

Using ORDERBY

Using SubQueries

Using Aggregate Functions

Using Queries that Return ResultSets

Properties-Based Methods of the Query Interface

Using Dynamic Queries

Enabling Dynamic Queries

Executing Dynamic Queries

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

Tuned EJB 1.1 CMP Updates in WebLogic Server

Optimized Database Updates for CMP 2.0 Entity Beans

Flushing the CMP Cache

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

Automatic Primary Key Generation for EJB 2.0 CMP

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

Multiple Table Mapping for EJB 2.0 CMP

Multiple Table Mappings for cmp-fields

Automatic Table Creation

Container-Managed Relationships

Understanding CMRs

Requirements and Limitations

Relationship Cardinality

Relationship Direction

Removing Relationships

Defining Container-Managed Relationships

Specifying Relationship in ejb-jar.xml

Specifying Relationships in weblogic-cmp-jar.xml

Using Relationship Caching for CMRs

Nested caching-elements

Relationship Caching Limitations

Cascade Delete

Cascade Delete Method

Database Cascade Delete Method

CMRs and Local Interfaces

Using the Local Client

Changes to the Container for Local Interfaces

Groups

Specifying Field Groups

Using EJB Links

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

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

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

Redeploying EJBs

The Redeploy Process

Steps to Redeploy

Deploying Compiled EJB Files

Deploying Uncompiled EJB Files

Deployment Restriction with Container Managed Relationships

WebLogic Server EJB Utilities

EJBGen

EJBGen Syntax

Surround Attributes that Contain Spaces With Double Quotes

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

DDConverter

Conversion Options Available with DDConverter

Using DDConverter to Convert EJBs

DDConverter Syntax

DDConverter Arguments

DDConverter Options

DDConverter Examples

weblogic.Deployer

weblogic.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 Deployment Elements in WebLogic Server 7.0 EJB

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

2.0 weblogic-ejb-jar.xml Deployment Descriptor Elements

allow-concurrent-calls

allow-remove-during-transaction

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

externally-defined

finders-load-bean

global-role

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

session-timeout-seconds

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

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

db-is-shared

stateful-session-persistent-store-dir

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

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

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

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