• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt about transaction context in statefull session Bean

 
Gowher Naik
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
 
Steven Colley
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.
 
Awishek sinha
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..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic