O'Reilly logo

Enterprise JavaBeans, Third Edition by Richard Monson-Haefel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 stateless session beans

Figure B-7. Creation and removal of stateless session beans

Table B-2 summarizes the operations that are legal for a stateless session bean. The allowed operations are the same for both EJB 2.0 and 1.1, except for the SessionContext methods getEJBLocalHome() and getEJBLocalObject(), which are specific to EJB 2.0.

Table B-2. Allowed operations for stateless session beans

Method

Allowed operations

 

Container-managed transactions

Bean-managed transactions

ejbCreate()

ejbRemove()

EntityContext methods:

getEJBHome()

getEJBLocalHome()

getEJBObject()

getEJBLocalObject()

JNDI ENC contexts:

Properties: java:comp/env

EntityContext methods:

getEJBHome()

getEJBLocalHome()

getEJBObject()

getEJBLocalObject()

getUserTransaction()

JNDI ENC contexts:

Properties: java:comp/env

Business methods

EntityContext methods:

getEJHome()

getEJBLocalHome()

getCallerPrincipal()

isCallerInRole()

getRollbackOnly()

setRollbackOnly()

getEJBObject()

getEJBLocalObject()

JNDI ENC contexts:

Properties: java:comp/env

Resource managers: java:comp/env/jdbc

EJB references: java:comp/env/ejb

EntityContext methods:

getEJHome()

getEJBLocalHome()

getCallerPrincipal() ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required