aspose file tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes What transaction attributes can apply to session bean methods in EJB 2.0? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » EJB Certification (SCBCD/OCPJBCD)
Reply Bookmark "What transaction attributes can apply to session bean methods in EJB 2.0?" Watch "What transaction attributes can apply to session bean methods in EJB 2.0?" New topic
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.
 
IntelliJ Java IDE
 
subject: What transaction attributes can apply to session bean methods in EJB 2.0?
 
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture