Session Beans

Stateless Session Beans

Life cycle state diagram of the stateless session bean

Figure B-6. Life cycle state diagram of the stateless session bean

Creation and removal of the stateless session bean

Figure B-7. Creation and removal of the stateless session bean

Table 2.3 and Table 2.4 summarize the operations that are legal for a stateless session bean.

Table B-3. Allowed Operations for Stateless Session Beans in EJB 1.1

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

Get Enterprise JavaBeans, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.