Most of my consulting engagements revolve around two products - Oracle Coherence and Oracle Toplink. While both have Caching component and caching in a distributed environment they are complementary and are built for two entire different purposes. Coherence is built for massive scalability for humongous amount of in memory data while Toplink is for persistence and can pretty much map any domain model with any data model. So the moment you find yourself in a situation where multiple applications need to share the same set of objects or need to be notified of changes in one application to another, a quick call with Oracle Professional services might help. One feature of Toplink that gets a little not so talked about is its ability to coordinate caches across multiple Toplink sessions. If your application is Toplink API driven and requires up to 500/600MB of in memory data some huge performance gains can be achieved using its Cache Coordination. During a recent project I got myself into some challenges while migrating a Toplink9g project and I hope this blog helps for future references.
- Cache Synchronization is now called Cache Coordination.
- Cache Coordination uses RCM and the old synchronization mechanism has been deprecated.
- Do not rely completely on Toplink10g workbench for creating sessions.xml
- Migrate to Toplink11g and it's workbench - It will make life much easier.
- If migrating 9g to 10g, 10g will work with the 9g's sessions.xml. 10g cache coordination configuration could be a challenge.
- Cache coordination is meant for mostly read-only and a low writes.
- If requirement is heavy object mutation across multiple instances or heterogeneous applications, consider Coherence.
- A sample setting for Cache Coordination using RMI
- Type: RMI
- Channel: ToplinkCommandChannel
- Multicast Group Address: 22.214.171.124
- Multicast Port: 25000
- Packet Time to Live: 2
- Announcement Delay: 1000
- Select Remove Connection on Error
- Select Synchronous
- URL for Registry Naming Service: rmi://$HOST:1099
- Starting rmiregistry
- rmiregistry.exe -J-Djava.class.path="classes;toplink.jar" -J-Djava.rmi.server.logCalls=true -J-Dsun.rmi.server.logLevel=VERBOSE -J-Dsun.rmi.client.logCalls
- Following is a simple sample sessions.xml
<?xml version="1.0" encoding="UTF-8"?>
<toplink-sessions version="11g (126.96.36.199.0)"