Implementation of the StateManager. Implemented here as one StateManager per Object so adds on functionality particular to each object. All PersistenceCapable objects will have a StateManager when they have had communication with the PersistenceManager. They will typically always have an identity also. The exception to that is for embedded/serialised objects.
Embedded/Serialised Objects
An object that is being embedded/serialised in an owning object will NOT have an identity unless the object is subject to a makePersistent() call also. When an object is embedded/serialised and a field is changed, the field will NOT be marked as dirty (unless it is also an object in its own right with an identity). When a field is changed any owning objects are updated so that they can update their tables accordingly.
Performance and Memory
StateManagers are very performance-critical, because for each PersistentCapable object made persistent, there will be one StateManager instance, adding up to the total memory footprint of that object. In heap profiling analysis, JDOStateManagerImpls showed to consume bytes 169 per StateManager by itself and about 500 bytes per StateManager when taking PC-individual child-object (like the OID) referred by the StateManager into account. With small Java objects this can mean a substantial memory overhead and for applications using such small objects can be critical. For this reason the StateManager should always be minimal in memory consumption.
@version $Revision: 1.190 $
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.