TopLink Essentials CachingTopLink Essentials provides a shared object cache to all persistent objects by default. If used in a cluster, or other programs access the database, there are several caching options in TopLink Essentials to handle stale data. Isolated cache (shared=false) : Allows the shared cache to be turned off for a class. ("toplink.cache.shared.<class>", ClassDesctiptor.setIsIsolated(boolean)). You can also set the cache size and type. ("toplink.cache.type.<class>", "toplink.cache.size.<class>"). You can also access the TopLink cache through the EntityManager API and explicitly invalidate objects. i.e. In TopLink 11g (preview), and EclipseLink (incubation) there are also several other caching options, including cache invalidation, and cache coordination. In terms of performance for bulk updates or deletes you can also consider using the JPA update-all, delete-all queries. These allow you to make large updates using JPQL and have optimal performance and ensure the cache is maintained. See also, http://en.wikibooks.org/wiki/Java_Persistence/Caching, http://en.wikibooks.org/wiki/Java_Persistence/Locking |