Interview Questions

Is there any default cache management system with Entity beans ?

EJB Interview Questions and Answers


(Continued from previous question...)

29. Is there any default cache management system with Entity beans ?

In other words whether a cache of the data in database will be maintained in EJB ? - Caching data from a database inside the Application Server are what Entity EJB’s are used for.The ejbLoad() and ejbStore() methods are used to synchronize the Entity Bean state with the persistent storage(database). Transactions also play an important role in this scenario. If data is removed from the database, via an external application - your Entity Bean can still be alive the EJB container. When the transaction commits, ejbStore() is called and the row will not be found, and the transaction rolled back.

(Continued on next question...)

Other Interview Questions