• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Doubt about transaction context in statefull session Bean

 
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How can statefull session bean access another bean or database in ejbCreate,ejbActivate,ejbPassivate and ejbRemove methods,because ejbCreate,ejbActivate,ejbPassivate and ejbRemove run in unspecified transaction context.

Thanks
 
Ranch Hand
Posts: 290
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Gowher..

Not sure..just trying to help you...wouldn't this rule just be applied for STATELESS session beans?

Ttyl
 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Stateless session bean cannot access DB or access another bean in ejbCreate and ejbRemove because there is no transaction context.
In stateless session bean it is fine as per logic

I have doubt in statefull bean.
if there is no transaction context for ejbCreate,ejbActivate,ejbPassivate and ejbRemove methods then How can statefull session bean access another bean or database.
 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Gowher Naik:
How can statefull session bean access another bean or database in ejbCreate,ejbActivate,ejbPassivate and ejbRemove methods,because ejbCreate,ejbActivate,ejbPassivate and ejbRemove run in unspecified transaction context.

Thanks


Hi Gowher
I think in order to access other bean methods it needs jndi context that is available inside ejbCreate,ejbActivate,ejbPassivate and ejbRemove methods also as the bean has acquired its beenhood it has access to resource manager connection factory which helps to get database base connection.
Let me know if i am wrong..
 
On top of spaghetti all covered in cheese, there was 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