• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
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.
 
Once upon a time there were three bears. And they were visted by a golden haired tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic