Design Guidelines
Use the following guidelines when employing an identity map:
- If using a Java 2-compatible Virtual Machine (VM), objects with a long lifespan, and object identity are important, use a
SoftCacheWeakIdentityMap or HardCacheWeakIdentityMap
policy. - If using a Java 2-compatible VM, and object identity is important but caching is not, use a
WeakIdentityMap
policy. - If an object has a long lifespan or requires frequent access, or is important, use a
FullIdentityMap
policy. - If an object has a short lifespan or requires frequent access, and identity is not important, use a
CacheIdentityMap
policy. - If objects are discarded immediately after being read from the database, such as in a batch operation, use a
NoIdentityMap
policy.
Note: The NoIdentityMap
does not preserve object identity.
Related Topics
About TopLink Descriptors
Specifying Optimistic Locking
Setting Identity Map Size
Using Object Identity
Caching Objects
Working with Identity Maps
Working with Descriptors
Copyright © 1997, 2004, Oracle.
All rights reserved.