|
| Problem | V3.5, V4, and V5 releases of WebSphere® Application Server do not support the isModified method for Enterprise JavaBeans™ (EJB™). This document provides an alternative to the isModified method to help you realize the advantage of not storing an EJB if the data in it has not been changed. | | Cause | The isModified methodology is not part of the J2EE™ specification and is not included in WebSphere Application Server. The isModified method was created in the EJB 1.1 specification as a work around. | | Solution | The value added by the isModified method is seen when creating a Bean Managed Persistence (BMP) EJB and preparing to do an ejbStore. The EJB calls isModified to see if the data in the EJB has been modified. It returns true if the data is changed and false if it is not. The application then decides whether to store the EJB. Not storing the EJB when it has not been changed saves processing time. To accomplish this in WebSphere, enhance the code in the EJB so that the bean code tracks modifications of the instance variables. You can do this by following these steps:
- Define a nonpersistent instance variable called isModified in the BMP.
- Make sure that methods that modify the persistent variables set this flag to true.
- When the variable is set to true, put code in the ejbStore method that writes to the database. ejbStore is still called; however, if the variable is not true, the method returns.
| |
| | |
| |
|
Product categories: Software, Application Servers, Distributed Application & Web Servers, WebSphere Application Server, EJB Container Operating system(s): AIX, HPUX, Linux, Multi-Platform, Solaris, Windows Software version: 3.5, 3.5.1, 3.5.2, 3.5.3, 3.5.4, 3.5.4.1, 3.5.4.2, 3.5.5, 3.5.6, 3.5.7, 4.0, 4.0.1, 4.0.2, 4.0.3, 4.0.4, 4.0.5, 4.0.6, 4.0.7, 4.1, 5.0, 5.0.1, 5.0.2, 5.0.2.1, 5.0.2.2, 5.0.2.3, 5.0.2.4, 5.0.2.5, 5.0.2.6, 5.1, 5.1.0.1, 5.1.0.2, 5.1.0.3, 5.1.0.4, 5.1.0.5, 5.1.1, 6.0 Software edition: Advanced, Base, Edition Independent, Network Deployment, Single Server Reference #: 1169895 IBM Group: Software Group Modified date: 2004-08-05
(C) Copyright IBM Corporation 2000, 2004. All Rights Reserved.
|