Chapter 8 Creating J2EE Applications for BEA WebLogic


ejbLoad() and ejbStore() Behavior for Entity EJBs

WebLogic Server reads and writes the persistent fields of entity EJBs using calls to ejbLoad() and ejbStore(). By default, WebLogic Server calls ejbLoad() and ejbStore() in the following manner:

  1. A transaction is initiated for the entity EJB. The client may explicitly initiate a new transaction and invoke the bean or WebLogic Server may initiate a new transaction in accordance with the bean's method transaction attributes.
  2. WebLogic Server calls ejbLoad() to read the most current version of the bean's persistent data from the underlying data store.
  3. When the transaction commits, WebLogic Server calls ejbStore() to write persistent fields back to the underlying datastore.

This simple process of calling ejbLoad() and ejbStore() ensures that new transactions always use the latest version of the EJB's persistent data, and always write the data back to the data store upon committing. In certain circumstances, however, you may want to limit calls to ejbLoad() and ejbStore() for performance reasons. Alternatively, you may want to call ejbStore() more frequently to view the intermediate results of uncommitted transactions.

WebLogic Server provides several deployment parameters that enable you to configure ejbLoad() and ejbStore() behavior.

 


Copyright (C) 2005. Sybase Inc. All rights reserved.