• 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
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
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.
 
She'll be back. I'm just gonna wait here. With this tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic