Information Technology Reference
In-Depth Information
with the client, stateless session beans do not do so. In the case of
a stateless session bean, each successive invocation of the bean is
treated as an independent activity.
Entity beans have the option to use two different kinds of per-
sistence mechanisms. First, container-managed persistence (CMP)
entails using entity beans, while all database access and synchroni-
zation is handled automatically by the EJB container. Second, bean-
managed persistence (BMP) entails using entity beans, while all data
access and synchronization is handled by hand-crafted custom code.
3. Message-Driven Beans (MDBs): Message-driven beans are EJBs
designed to be asynchronous consumers and processors of JMS
messages. These were introduced newly in J2EE 1.3 and are use-
ful for situations where synchronicity is not essential, for example,
integrating loosely coupled systems. Session beans employ Remote
Procedure Call (RPC)-based communication, which has the dis-
advantage that the sender must wait for a response before it can
undertake the next activity. Message-driven beans are stateless, and,
unlike session and entity beans, Message-driven beans do not have
published interfaces.
Message-driven beans are useful for achieving the following:
• Efficiency: Messaging can be used for separating out those elements
of the business logic that can be processed independent of the main
thread of processing. This enables the main thread to obviate the
need to expend resources and time on nonessential operations and
move on to the next requests.
• Decoupling: Different subsystems are developed so that they are not
tightly integrated with each other.
• Flexible integration: Loosely coupled systems can be composed by
using Message-driven beans to wrap existing systems.
6.2.4.2 Horizontal Services
These are general services that are required across multiple tiers in enter-
prise application.
6.2.4.2.1 Java Database Connectivity (JDBC)
JDBC enables via database neutral APIs to perform a host of operations like
obtaining database connections, execute SQL queries and updates via these
connections, and process the results of such queries. The J2EE extensions
also provide support for connection pooling and distributed transactions.
The database driver modules in the JDBC are responsible for mapping a
database neutral request onto the request expected by a specific RDBMS.
Search WWH ::




Custom Search