Oracle TopLink enables you to scale out JPA applications using Oracle Coherence. TopLink Grid provides applications with a number of options on how they can scale, ranging from using Coherence as a distributed shared (L2) cache up to directing JP QL queries to Coherence for parallel execution across the grid to reduce database load. With TopLink Grid, you do not have to rewrite your applications to scale out. You can use your investment in JPA, and still take advantage of the scalability of Coherence.
TopLink Grid provides the following benefits:
Simple application configuration using annotations or XML configurations that align with standard JPA.
The ability to store complex object graphs with relationships in Coherence.
The ability to selectively choose which entities are stored in the grid and which are stored directly in the backing database.
Allows you to execute JP QL queries in the Grid or directly against the database.
Allows you to store entities with both eager and lazy relationships into Coherence.
You can use the Coherence API with caches backed by TopLink Grid to access relational data with special cache loader and cache store interfaces which have been implemented for JPA.
In this traditional Coherence approach, TopLink Grid provides the
CacheStore implementations in the
oracle.eclipselink.coherence.standalone package that are optimized for EclipseLink JPA. This technique is described in the Integration Guide for Oracle Coherence.
You can build applications using JPA and transparently use the power of the data grid for improved scalability and performance. In this JPA on the Grid approach, TopLink Grid provides a set of cache and query configuration options that allow you to control how EclipseLink JPA uses Coherence. These implementations reside in the
oracle.eclipselink.coherence.integrated package. See Chapter 2, "JPA on the Grid Configurations" for more information.
If you have existing Native ORM applications, then you can use the EclipseLink Native Object Relational Mapping (ORM) framework with them. The Native ORM approach is very similar to JPA on the Grid, however, it does not use annotations to configure how the cache is used. Instead, this approach employs an amendment method that defines the appropriate cache behavior. See Chapter 3, "EclipseLink Native ORM Configurations" for more information.
When integrating JPA applications with the Coherence data grid, note the potential benefits and restrictions. You must understand how the grid works and how it relates to your JPA configurations to realize the full potential.