• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

EJB2.0 stateful session bean ejbCreate()

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 563
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 sure was nice of your sister to lend us her car. Let's show our appreciation by sharing this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic