Friday, December 16, 2011

JPA using Coherence as Level 2 Cache

quite cool this video on TopLink grid with COH in WL Cluster.



In a nutshell:

  • Coherence can cache DB data in a cluster-wide manner
  • Grid Cache mode uses Coherence to cache (read-through) objects by ID
  • Grid Read mode turns JPQL queries into COH Grid queries
  • Grid Entity mode supports read and writes directly into the Cache

Grid Entity can be tricky, because updates are asynchronous and they could fail, leaving the cache out of sync with the DB.

Recommended model:
Out-Of-Process, COH is in a different JVM as the Application Server.

In-Process: everything in the same JVM. Good only for development.

Mixed model (some data in near-cache, some in far-cache) can be useful in some applications.



Second part:





it's quite cool, it shows how to create a COH cluster and server, how to configure a WL server for COH. It gives an example of a Grid Entity mode to offload DB writes.


Here the example
http://blogs.oracle.com/jeffwest/entry/introducing_the_oracle_parcel_serviceexamplereference_application


and the code is on SVN at https://svn.java.net/svn/oracle-pacel-svc~ops-r3-ee6

COOL!

No comments: