| Author |
What transaction attributes can apply to session bean methods in EJB 2.0?
|
Joseph Zhou
Ranch Hand
Joined: Aug 01, 2000
Posts: 129
|
|
|
all of them? or there is difference between stateful and stateless?
|
 |
Seema Manivannan
Ranch Hand
Joined: Sep 20, 2001
Posts: 128
|
|
There is a restriction only if the session bean implements the javax.ejb.SessionSynchronization interface. In this case, the allowed transaction attributes are: Required, RequiresNew, or Mandatory.This is to ensure that the enterprise bean is invoked only in a transaction. Note that only stateful session beans can implement the SessionSynchronization interface. Thanks Seema [ September 25, 2003: Message edited by: seema manivannan ]
|
Seema Manivannan<br />Author and Trainer: Java Certifications<br /> <br />Whizlabs Software<br />Success, certified!<br />Global leader: J2EE certification exam preparation!<br /><a href="http://www.whizlabs.com" target="_blank" rel="nofollow">http://www.whizlabs.com</a><br /> <br />An ISO 9001-2000 certified company!
|
 |
hover cheng
Ranch Hand
Joined: Feb 11, 2003
Posts: 66
|
|
IMHO, only Mandatory, Required, RequiresNew can be specified for Container-managed transaction demarcated session bean. In chapter 17.4.1, ejb spec 2.0:
For entity beans that use EJB 2.0 container-managed persistence, only the Required, RequiresNew, or Mandatory transaction attributes should be used for the methods defined in the bean�s component interface and all the direct and indirect superinterfaces of the component interface, excluding the getEJBHome, getEJBLocalHome, getHandle, getPrimaryKey, and isIdentical methods; and for the methods defined in the bean�s home interface and all the direct and indirect superinterfaces of the home interface, excluding the getEJBMetaData and getHomeHandle methods specific to the remote home interface. Containers may optionally support the use of the NotSupported, Supports, and Never transaction attributes for the methods of entity beans with container-managed persistence. However, entity beans with container-managed persistence that use these transaction attributes will not be portable.
So, the NotSupported, Supports and Never only apply for Entity Bean with CMP.
|
SCJP 91% SCJD 94% SCBCD 98% SCWCD1.4 86%<p>XML141 SCDWJS -- in progress<br />If you don't retreat, you are mostly among those who can surmount it.
|
 |
 |
|
|
subject: What transaction attributes can apply to session bean methods in EJB 2.0?
|
|
|