Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes EJB and other Java EE Technologies and the fly likes why do we need ejbactivate  and ejbpassivate Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Reply Bookmark "why do we need ejbactivate  and ejbpassivate" Watch "why do we need ejbactivate  and ejbpassivate" New topic
Author

why do we need ejbactivate and ejbpassivate

firoz silar
Greenhorn

Joined: Dec 24, 2005
Posts: 11
hi,
can any body tell me briefy.
why do we need ejbActivate and ejbPassivate methods in
Stateless session bean.
ak pillai
author
Ranch Hand

Joined: Feb 11, 2006
Posts: 288
To have a consistent interface, so that there is no different interface that you need to implement for Stateful Session Bean and Stateless Session Bean.
Both Stateless and Stateful Session Bean implement javax.ejb.SessionBean and this would not be possible if stateless session bean is to remove ejbActivate and ejbPassivate from the interface.
You could argue that the two (stateful and stateless) are so different that they should have their own interface but Sun did not think so. They made both session beans implement the same interface and provided deployment descriptor to denote which one is it that you are deploying.


java j2ee job interview questions with answers | Learn the core concepts and the key areas
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: why do we need ejbactivate and ejbpassivate
 
Similar Threads
operation allowed in session and entity beans
ejbActivate() and ejbPassivate()
SLSB Pool & Entity Bean Pool
StateFUL - why allow BMT in activate()/passivate() ?
question on activation/passivation