when is ejbLoad called
2 posts in topic
Flat View  Flat View

Posted By:   Herbert_Maier
Posted On:   Sunday, April 15, 2001 03:01 PM

Is the ejbLoad method called everytime when the database has changed?

Re: when is ejbLoad called

Posted By:   Nidhi_Madan  
Posted On:   Wednesday, April 18, 2001 09:06 PM

Hello Herbert,
ejbLoad() is called when the bean is in the ready state, ie. the bean is able to accept the invocations of its buisness methods.
ejbLoad() reads the data from the database and uses it to populate instance variables.
In case of container-managed persistence , ejbLoad() is invoked after the container has loaded the objects data.

Re: when is ejbLoad called

Posted By:   AlessandroA_Garbagnati  
Posted On:   Sunday, April 15, 2001 05:07 PM


I think that it all depends by the implementation of the specs, but I don't think that any application server is actually maintaining a thread that checks table and call this method every time a change is done. It would be extremely time and resource consuming.

The basic concept is that the ejbLoad() method is responsible of trasfering the entity from the database to the bean.

What it's probably happening, is that every time there is an acces to the bean, the application servers takes care of calling the method to re-syncronize the bean with the corresponding database entity.
About | Sitemap | Contact