• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

EJB2.0 stateful session bean ejbCreate()  RSS feed

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can another bean's methods and resource manager (like database) be accessed from ejbCreate() for a stateful session bean.Headfirst book (Chapter 4. Page:196)

1) can you please explain the bean things that can be done during ejbCreate(). For example, will ejbCreate() method have a transaction in CMT. If it doesnt have a transaction, then how is able to access another bean's reference and resource manager.
 
Ranch Hand
Posts: 549
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Operations allowed in a stateful session bean, in the ejbCreate method :

CMT :
SessionContext methods: getEJBHome, getEJBLocalHome, getCallerPrincipal,
isCallerInRole, getEJBObject, getEJBLocalObject
JNDI access to java:comp/env
Resource manager access
Enterprise bean access

BMT :
SessionContext methods: getEJBHome,getEJBLocalHome, getCallerPrincipal,
isCallerInRole, getEJBObject, getEJBLocalObject, getUserTransaction
UserTransaction methods
JNDI access to java:comp/env
Resource manager access
Enterprise bean access

Check the specs for more information.
 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At this point, we cannot use CMT. CMT starts when we call methods which have a transaction context. But BMT can be used.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!