GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  J2EE  >  EJB
Go To First  |  Previous Question  |  Next Question 
 EJB  |  Question 171 of 175    Print  
What is the difference between ejbstore and ejbload?

  
Total Answers and Comments: 4 Last Update: July 03, 2009     Asked by: jabi 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: VenkitaKrishnan
 
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.

Above answer was rated as good by the following members:
geeky920
November 19, 2007 06:37:41   #1  
Amol Patil        

RE: What is the difference between ejbstore and ejbloa...
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.

 
Is this answer useful? Yes | No
April 17, 2009 07:49:31   #2  
satin40 Member Since: July 2007   Contribution: 3    

RE: What is the difference between ejbstore and ejbload?
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.
 
Is this answer useful? Yes | No
April 20, 2009 01:22:30   #3  
VenkitaKrishnan Member Since: April 2007   Contribution: 7    

RE: What is the difference between ejbstore and ejbload?
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.

 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
July 03, 2009 05:21:33   #4  
AkshataShriyan Member Since: July 2009   Contribution: 4    

RE: What is the difference between ejbstore and ejbload?
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

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape