What is the difference between ejbstore and ejbload?

Showing Answers 1 - 12 of 12 Answers

Amol Patil

  • Nov 19th, 2007
 

ejbLoad is called to notify the entity bean that its state has just been refreshed from the database.

ejbStore is called to notify the entity bean that its state is about to be flushed to the database.

satin40

  • Apr 17th, 2009
 

sjbStore update the persistent storate with the updated values of the bean while ejbLoad get the values from the database and set the properties of a bean. Container calls them intermediately to keep the database consistent.

These 2 callback methods are avaliable in the EntityBean Interface and will be used by the container to load the data from the Database into the Bean (ejbLoad) and from the bean to the Database (ejbStore).

We have to manually implemented these methods if we are using BMP (Bean Managed Persistence), although no one is using it in that fashion.

From EJB Specs 2.1, CMP (Container Managed Persistence) has become much easier and these 2 call back methods will be implemented by the container for you.

They are call back methods.

They are used to notify ejb beans of the state.

Called at the boundaries of the transaction.

Whenever tx.begin(), ejbload() is called to notify beans of data being refreshed

Whenever tx.commit, ejbstore() is called to notify beans that data is being persisted

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions