ejbLoad, ejbStore calls for CMP entity bean.
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   akshat_n
Posted On:   Wednesday, September 10, 2003 03:40 AM

How the container decide that its the time to call ejbLoad, ejbStore or ejbRemove method for CMP entity bean? if i need to update database 5 times then will it be calling ejbStore 5 times. if yes then how come it know about those changes i need to make? if no then what does it do?

Re: ejbLoad, ejbStore calls for CMP entity bean.

Posted By:   Cherian_Mathew  
Posted On:   Wednesday, September 10, 2003 10:41 PM

Calling ejbStore() will cause the container to call the ejbPassivate() which will clear all the resources used at that point of time. You can have some custom codes in ejbPassivate() for eg. to close some database connection. ejbLoad() will make the contiainer to call ejbActivate() method which will update all the persistence fields and all the non-persistence fields will have garbage values. You cannot directly call ejbPassivate() and ejbAcitivate(). But still it depends on vendor.

For an CMP Bean, you dont have worry about these things. Everything is inbuild.

You have to use ejbPassivate() and ejbActivate() in Sateful Session Bean(SSB) only. These are there in Entity beans, but it is the inside part. The latter methods will have some meaning only when you use it in SSB.

Regards,
Cherry

Re: ejbLoad, ejbStore calls for CMP entity bean.

Posted By:   dipankar_datta  
Posted On:   Wednesday, September 10, 2003 04:35 AM

ejbRemove will be called when you call remove()on remote/local interface.

Calling ejbLoad/ejbStore depends on vendor but typically it will be once per transaction ie ejbload at begaining & ejbstore at end.
About | Sitemap | Contact