Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Explain Stateful session bean life cycle?

Answer Posted / hari

Life Cycle of a Stateful Session Bean

While in the ready stage, the EJB container may decide to deactivate, or passivate, the bean by moving it from memory to secondary storage. (Typically, the EJB container uses a least-recently-used algorithm to select a bean for passivation.) The EJB container invokes the bean's ejbPassivate method immediately before passivating it. If a client invokes a business method on the bean while it is in the passive stage, the EJB container activates the bean, moving it back to the ready stage, and then calls the bean's ejbActivate method.

At the end of the life cycle, the client invokes the remove method and the EJB container calls the bean's ejbRemove method. The bean's instance is ready for garbage collection.

Your code controls the invocation of only two life-cycle methods--the create and remove methods in the client. All other methods in are invoked by the EJB container. The ejbCreate method, for example, is inside the bean class, allowing you to perform certain operations right after the bean is instantiated. For instance, you may wish to connect to a database in the ejbCreate method.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is ejb a framework?

913


How can a session bean be configured for transactions of bean-managed?

1037


What is the advantage of using entity bean for database operations, over directly using jdbc api to do database operations?

945


Can remove() be a Stateless Session bean?

1035


Differentiate “find a method” from “select method” in EJB ?

933


How can enterprise javabeans be accessed from active server pages?

966


What do you mean by in-memory replication?

1013


What are the different kind of ejb's?

948


Write down the steps for the creation of stateless ejb.

953


What is the difference between session and entity beans? When should I use one or the other?

914


Enlist the CallBack methods of Session Bean?

990


The ejb container implements the ejbhome and ejbobject classes. For every request from a unique client, does the container create a separate instance of the generated ejbhome and ejbobject classes?

946


can u explain about design patterns like singleton,builder,factory

2286


What is remote interface in ejb?

908


What is Enterprise JavaBeans Query Language (EJB QL)?

887