Chapter 8 Creating J2EE Applications for BEA WebLogic
Note that this method is used for 1.1 CMP beans only. WebLogic Server's 2.0 CMP implementation automatically detects modifications of CMP fields and writes only those changes to the underlying datastore. We recommend that you do not use is-modified-method-name with BMP as you would need to create both the is-modified-method-name method, and the ejbstore.
By default, WebLogic Server calls ejbStore() at the successful completion (commit) of each transaction. ejbStore() is called at commit time regardless of whether the EJB's persistent fields were actually updated. WebLogic Server provides the is-modified-method-name deployment parameter for cases where unnecessary calls to ejbStore() may result in poor performance.
To use is-modified-method-name, EJB providers must first develop an EJB method that "cues" WebLogic Server when persistent data has been updated. The method must return "false" to indicate that no EJB fields were updated, or "true" to indicate that some fields were modified.
The EJB provider or EJB deployment descriptors then identify the name of this method using the is-modified-method-name element in weblogic-ejb-jar.xml. WebLogic Server calls the specified method name when a transaction commits, and calls ejbStore() only if the method returns "true."
is-modified-method-name can improve performance by avoiding unnecessary calls to ejbStore(). However, it places a greater burden on the EJB developer to correctly identify when updates have occurred. If the specified is-modified-method-name returns an incorrect flag to WebLogic Server, data integrity problems can occur, and they may be difficult to track down.
If entity EJB updates appear to become "lost" in your system, start by ensuring that all is-modified-method-name methods return "true" under every circumstance. In this way, you can revert to WebLogic Server's default ejbStore() behavior and possibly correct the problem.
Copyright (C) 2005. Sybase Inc. All rights reserved. |
![]() |