Active In SP
Joined: Sep 2010
24-12-2010, 12:27 PM
unit2 presentation.ppt (Size: 687 KB / Downloads: 71)
unit3 presentation.ppt (Size: 661.5 KB / Downloads: 71)
EJB are write once, run any where, middle tier components
A EJB system is logically a three-tier system. The three tiers are
2. EJB server
EJB specifies an execution environment
Container provides services in EJB
Container does not allow to access bean
directly from client
EJB Exists in the Middle tier
Business rules (Methods)
EJB Supports transaction processing
Container start a new transaction when the bean
Bean be allowed to manage its own transaction
4. EJB can maintain states
Container keep track of state information
You can build states less EJB
5. EJB is Simple
Persistent storage of state
“ Write once run anywhere”
EJB Logical Architecture
A EJB system is logically a three-tier system
The three tiers are as follows:
a) The Client
b) The EJB Server
c) The Database (or other persistent store)
Logical - because - these tiers may be single machines.
EJB’s role in each of these tiers are:
a) Client side makes call to remote EJBs. The
client needs to know how to find the EJB server
and how to interact.
b) The EJB components live in the middle tier.
The EJB objects reside inside an EJB container,
which in turn resides in an EJB server.
c) EJB can access the database themselves,
typically via Java Database connecting (JDBC).
EJB’s Software Architecture
The diagram presents a high-level view of
the EJB architecture, showing the various
relationships between the various components.
Key Features of the EJB Architecture
EJB bean exists within the container
The bean and the client not directly access the
server – all access is performed against the container.
Rather it talks to the bean through its home
interface and its remote interface, both of which are
provided by the container.
EJB server handle requests for the container, and
feed the container incoming client requests.
Joined: Apr 2012
21-08-2012, 04:37 PM
transaction.ppt (Size: 317.5 KB / Downloads: 18)
a transaction is often defined as an indivisible unit of work
Requirement on Transaction
A transaction can end in two ways:
with a commit or
with a rollback.
In case of transaction commits, the data modifications made by its statements are saved. Otherwise, the transaction rolls back, undoing the effects of all statements in the transaction.
A series of operations that are performed atomically
A successful transaction is committed
A failed transaction is aborted
all or nothing proposition
EJB specification only mandates to flat transactions
Container managed Transactions
Bean managed Transactions
Client managed Transactions
looking up UserTransaction in the JNDI registry
Container Managed Transactions
For a enterprise bean
immediately before a method starts
just before the method exits.
Each method can be associated with a single transaction.
Nested or multiple transactions are not allowed within a method.
To specify which of the bean’s methods are associated with transactions
set transaction attributes.
must not use any transaction management methods
must not use javax.transaction.UserTransaction interface.
Setting Transaction Attribute
Requires a javax.ejb.TransactionAttribute annotation, and setting it to one of the javax.ejb.TransactionAttributeType constants.
Rolling Back Transaction
If a system exception is thrown, the container will automatically roll back the transaction.
By invoking the setRollbackOnly method of the EJBContext interface, the bean method instructs the container to roll back the transaction.
Synchronizing a Session Bean’s Instance Variables
SessionSynchronization interface, which is optional, allows stateful session bean instances to receive transaction synchronization notifications.
The container invokes the SessionSynchronization methods (afterBegin, beforeCompletion, and afterCompletion) at each of the main stages of a transaction.
Methods not allowed
The commit, setAutoCommit, and rollback methods of java.sql.Connection
The getUserTransaction method of javax.ejb.EJBContext
Any method of javax.transaction.UserTransaction
|Possibly Related Threads...|
|LIBRARY OPERATIONS USING EJB||seminar ideas||0||346||
04-05-2012, 11:16 AM
Last Post: seminar ideas
|Enterprise Java Beans (EJB) integration||seminar paper||1||788||
17-04-2012, 02:43 PM
Last Post: seminar ideas
|Hello World application with EJB||seminar paper||0||415||
14-03-2012, 04:35 PM
Last Post: seminar paper