This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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

ejbActivate and EntityContext

 
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Can anybody explain me why entity bean's ejbActivate method can't do following on EntityContext
1. get security information about client.
2. force a transaction to rollback(CMT beans)
3. find out if the transaction has already been set to rollback(CMT beans)
4. get a transaction reference, and call methods on it (BMT beans only, so entities can't use this)
Regards
Mini
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The answer to all your questions is no due to the fact that there is no client during ejbActivate. Therefore there is no transaction.
 
mini mehta
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Nathaniel Stoddard:
The answer to all your questions is no due to the fact that there is no client during ejbActivate. Therefore there is no transaction.


I guess ejbActivate method of entity bean is called by container when the bean is picked up from the pool to serve a client when it invokes the entity beans business method. So there is a client during ejbActivate.
Can I ask authors of HFE to explain the above, as most of the stuff related to SessionContext and EntityContext with regards to beanness is not explained properly.
Thanks
Mini
 
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The way I remember it (not really true "why") is to follow a bean through a lifecycle. Entity beans are CMT beans and say we were in a transaction and am about to get passivated - oops no-can-do! The only time the container would passivate me is if I was NOT in a transaction. So since the only time passivate is used is for beans not in a transaction, they don't need to get to the transaction stuff. Then for activate, I just remember that it's only logical that the bean is just on it's way back to method ready, and would have the same thing as it left with.
--Dale--
 
when your children are suffering from your punishment, tell your them it will help them write good poetry when they are older. Like 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