Entity Beans - MACROMEDIA 38000382 - JRun - Mac Getting Started Manual

Getting started guide
Table of Contents

Advertisement

provide a high-level interface facade to business processes, in which session bean methods
perform a unit of work, calling one or more methods in one or more entity beans.
For more information, see JRun Programmer's Guide.
Stateful session beans
You can perform some business processes in a single business request, such as computing
the price of goods or verifying a credit card account. Other business processes are more
drawn out and last across multiple requests and transactions. For example, on an
e-commerce website, adding items to an online shopping cart spans multiple method
requests. The business process must track the user's state from request to request. Stateful
session beans maintain a conversational state on behalf of a client. If a stateful session
bean changes during a method invocation, that same state is available to the client on the
following invocation.
When used in a clustered environment, JRun supports failover by maintaining stateful
session-bean state across the cluster.
For more information, see JRun Programmer's Guide.

Entity beans

Entity beans represent objects that persist through a server shutdown. The data
representing an instance of an entity bean is typically stored in rows and tables of a
relational database, which you access using a JDBC data store. These tables can also span
multiple databases.
There are two types of entity bean persistence:
Bean-managed persistence (BMP)
persistence by coding database access and update statements in callback methods.
Container-managed persistence (CMP)
in the deployment descriptor to perform database access and update statements
automatically.
BMP
In BMP, the developer manages persistence by coding the appropriate database update
code in callback methods. For example, the
and the
For more information, see the
directory of the samples server.
CMP
In CMP, the container manages persistence by automatically synchronizing the bean with
the database at certain points in the lifecycle. With CMP, your bean implementation
coding is simpler and can focus on the business logic.
The EJB 2.0 specification requires that application servers support EJB 1.1 CMP and
EJB 2.0 CMP.
50
Chapter 5 Introduction to EJB
ejbFindByPrimaryKey
CreditCard
The entity bean implementation manages
The container uses specifications made
ejbUpdate
method locates a database row using the primary key.
and
Reservation
method updates the database,
EJBs in the compass-ear

Advertisement

Table of Contents
loading

This manual is also suitable for:

Jrun 4

Table of Contents