You can use the ObjectGrid cache plugin with the application server to improve query performance in JPA applications.
Cache functionality in OpenJPA
The JPA specification allows users the option of storing frequently used data in the memory to improve performance. OpenJPA provides concurrent data and concurrent query caches that allow applications to save persistent object data and query results in memory to share among threads and for use in future queries. Although this can speed up application access times, the OpenJPA caching mechanism requires additional implementation to support data synchronization and is not easily used in distributed server environments. However, you can employ a third-party cache management plugin to replace the cache management that is included with OpenJPA.
IBM ObjectGrid with the WebSphere Application Server and JPA
OpenJPA allows users to employ a third-party cache management plugin that replaces that which is included with the implementation. IBM ObjectGrid Version 6.1 can be used as a plugin with OpenJPA and JPA for the application server, and it provides comprehensive in-memory database functionality for distributed, highly available cluster environments.
For more information about IBM ObjectGrid, visit the IBM developerWorks site.