WebSphere Application Server support for isModified method for Enterprise Java Beans
 Technote (troubleshooting)
 
Problem(Abstract)
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.
 
Resolving the problem
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:

  1. Define a nonpersistent instance variable called isModified in the BMP.

  2. Make sure that methods that modify the persistent variables set this flag to true.

  3. 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.
 
 
Cross Reference information
Segment Product Component Platform Version Edition
Application Servers Runtimes for Java Technology Java SDK
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > EJB Container
Operating system(s): Windows
Software version: 6.0
Software edition:
Reference #: 1169895
IBM Group: Software Group
Modified date: Sep 9, 2004