Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Doubt about transaction context in statefull session Bean

 
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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..
 
I carry this gun in case a vending machine doesn't give me my fritos. This gun and this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic