|
Allowed Operations
|
Method
|
Container-Managed Transactions
|
Bean-Managed Transactions
|
setSessionContext()
|
EntityContext methods:
getEJBHome()
JNDI ENC contexts:
Properties java:comp/env
|
EntityContext methods:
getEJBHome()
JNDI ENC contexts:
Properties java:comp/env
|
ejbCreate()
ejbRemove()
|
EntityContext methods:
getEJBHome()
getEJBObject()
JNDI ENC contexts:
Properties java:comp/env
|
EntityContext methods:
getEJBHome()
getEJBObject()
getUserTransaction()
JNDI ENC contexts:
Properties java:comp/env
|
business methods
|
EntityContext methods:
getEJHome()
getCallerPrincipal()
isCallerInRole()
getRollbackOnly()
setRollbackOnly()
getEJObject()
JNDI ENC contexts:
Properties java:comp/env
Resource Managers java:comp/env/jdbc
EJB references java:comp/env/ejb
|
EntityContext methods:
getEJHome()
getCallerPrincipal()
isCallerInRole()
getEJObject()
getUserTransaction()
JNDI ENC contexts:
Properties java:comp/env
Resource Managers java:comp/env/jdbc
EJB references java:comp/env/ejb
|
ejbActivate()
ejbPassivate()
|
Not Supported
(stateless beans do not use these methods)
|
Not Supported
(stateless beans do not use these methods)
|
|
Allowed Operations
|
Method
|
Container-Managed Transactions
|
Bean-Managed Transactions
|
setSessionContext()
|
EntityContext methods:
getEnvironment()
getEJBHome()
|
EntityContext methods:
getEnvironment()
getEJBHome()
|
ejbCreate()
ejbRemove()
|
EntityContext methods:
getEnvironment()
getEJBHome()
getEJBObject()
|
EntityContext methods:
getEnvironment()
getEJBHome()
getEJBObject()
getUserTransaction()
|
business methods
|
EntityContext methods:
getEnvironment()
getEJHome()
getCallerPrincipal()
isCallerInRole()
getRollbackOnly()
setRollbackOnly()
getEJObject()
|
EntityContext methods:
getEnvironment()
getEJHome()
getCallerPrincipal()
isCallerInRole()
getEJObject()
getUserTransaction()
|
ejbActivate()
ejbPassivate()
|
Not Supported
(stateless beans do not use these methods)
|
Not Supported
(stateless beans do not use these methods)
|
|
Allowed Operations
|
Method
|
Container-Managed Transactions
|
Bean-Managed Transactions
|
setSessionContext()
|
EntityContext methods:
getEJBHome()
JNDI ENC contexts:
Properties java:comp/env
|
EntityContext methods:
getEJBHome()
JNDI ENC contexts:
Properties java:comp/env
|
ejbCreate()
ejbRemove()
ejbActivate()
ejbPassivate()
|
EntityContext methods:
getEJBHome()
getCallerPrincipal()
isCallerInRole()
getEJBObject()
JNDI ENC contexts:
Properties java:comp/env
Resource Managers java:comp/env/jdbc
EJB references java:comp/env/ejb
|
EntityContext methods:
getEJBHome()
getCallerPrincipal()
isCallerInRole()
getEJBObject()
getUserTransaction()
JNDI ENC contexts:
Properties java:comp/env
Resource Managers java:comp/env/jdbc
EJB references java:comp/env/ejb
|
business methods
|
EntityContext methods:
getEJHome()
getCallerPrincipal()
isCallerInRole()
getRollbackOnly()
setRollbackOnly()
getEJObject()
JNDI ENC contexts:
Properties java:comp/env
Resource Managers java:comp/env/jdbc
EJB references java:comp/env/ejb
|
EntityContext methods:
getEJHome()
getCallerPrincipal()
isCallerInRole()
getEJObject()
getUserTransaction()
JNDI ENC contexts:
Properties java:comp/env
Resource Managers java:comp/env/jdbc
EJB references java:comp/env/ejb
|
afterBegin()
beforeCompetion()
|
EntityContext methods:
getEJHome()
getCallerPrincipal()
isCallerInRole()
getRollbackOnly()
setRollbackOnly()
getEJObject()
JNDI ENC contexts:
Properties java:comp/env
Resource Managers java:comp/env/jdbc
EJB references java:comp/env/ejb
|
Not Supported
(bean-managed transaction beans can not implement the
SessionSynchronization interface)
|
afterCompletion()
|
EntityContext methods:
getEJBHome()
getCallerPrincipal()
isCallerInRole()
getEJBObject()
JNDI ENC contexts:
Properties java:comp/env
|
Not Supported
(bean-managed transaction beans can not implement the
SessionSynchronization interface)
|
|
Allowed Operations
|
Method
|
Container-Managed Transactions
|
Bean-Managed Transactions
|
setSessionContext()
|
EntityContext methods:
getEnvironment()
getEJBHome()
|
EntityContext methods:
getEnvironment()
getEJBHome()
|
ejbCreate()
ejbRemove()
ejbActivate()
ejbPassivate()
|
EntityContext methods:
getEnvironment()
getEJBHome()
getCallerPrincipal()
isCallerInRole()
getEJBObject()
|
EntityContext methods:
getEnvironment()
getEJBHome()
getCallerPrincipal()
isCallerInRole()
getEJBObject()
getUserTransaction()
|
business methods
|
EntityContext methods:
getEnvironment()
getEJHome()
getCallerPrincipal()
isCallerInRole()
getRollbackOnly()
setRollbackOnly()
getEJObject()
|
EntityContext methods:
getEnvironment()
getEJHome()
getCallerPrincipal()
isCallerInRole()
getEJObject()
getUserTransaction()
|
afterBegin()
beforeCompetion()
|
EntityContext methods:
getEnvironment()
getEJHome()
getCallerPrincipal()
isCallerInRole()
getRollbackOnly()
setRollbackOnly()
getEJObject()
|
Not Supported
(bean-managed transaction beans can not implement the
SessionSynchronization interface)
|
afterCompletion()
|
EntityContext methods:
getEnvironment()
getEJBHome()
getCallerPrincipal()
isCallerInRole()
getEJBObject()
|
Not Supported
(bean-managed transaction beans can not implement the
SessionSynchronization interface)
|
Transaction Scope
|
Transactional Type Attributes
|
Exception Thrown
|
Container's Action
|
Client's View
|
Client Initiated Transaction
Transaction is started by the client (application or bean) and is
propagated to the bean method.
|
transaction-type =
Container
transaction-attribute =
Required |
Mandatory |
Supports |
|
Application Exception
|
If the bean invoked EJBContext.setRollbackOnly(),
then mark the client's transaction for rollback.
Rethrow Application Exception.
|
Receives the Application Exception. The client's transaction
may or may not have been marked for rolled back.
|
|
|
System Exception
|
Mark the client's transaction for roll back.
Log the error.
Discard the instance.
Rethrow TransactionRollbackException.
|
Receives the TransactionRollbackException
The client's transaction has been rolled back.
|
Container Initiated Transaction
The transaction started when the bean's method was invoked and
will end when method completes.
|
transaction-type =
Container
transaction-attribute =
Required |
Requires New
|
Application Exception
|
If bean called EJBContext.setRollbackOnly(), then
rollback the transaction and rethrow the Application Exception.
If bean didn't explicitly rollback the transaction, then
attempt to commit the transaction and rethrow the Application
Exception.
|
Receives the Application Exception. The bean's transaction may
or may not have been rolled back. The client's transaction is
not affected.
|
|
|
System Exception
|
Roll back the transaction.
Log the error.
Discard the instance.
Rethrow RemoteException.
|
Receives the RemoteException.
The bean's transaction was rolled back.
The client's transaction is not affected.
|
Bean is not part of a transaction
The bean was invoked but does not propagate the client's
transaction and does not start its own transaction.
|
transaction-type =
Container
transaction-attribute =
Never |
Not Supported |
Supports |
|
Application Exception
|
Rethrow Application Exception
|
Receives the Application Exception.
The client's transaction is not affected.
|
|
|
System Exception
|
Log the error.
Discard the instance.
Rethrow RemoteException.
|
Receives the RemoteException.
The client's transaction is not affected.
|
Bean Managed Transaction.
The stateful or stateless session bean use the EJBContext to
explicitly manage its own transaction.
|
transaction-type =
bean
transaction-attribute =
Bean-Managed Transaction beans do not use transaction attributes.
|
Application Exception
|
Rethrow the Application Exception.
|
Receive the Application Exception.
The client's transaction is not affected.
|
|
|
System Exception
|
Roll back the transaction.
Log the error.
Discard the instance.
Rethrow RemoteException.
|
Receives the RemoteException.
The client's transaction is not affected.
|