Distributed Cache Synchronization

I'm trying to implement distributed cache synchronization via RMI but I find the documentation to be very limited on how to do this. I'm doing exactly what the documentation says and I end up with a CommunicationException when trying to connect to the pre-existing session. The toplink docs are not very descriptive about the cause or meaning of CommunicationException.
Also, this is in toplink 3.6 which I know is old, but comparing it with the new oracle versions the requirements for DCS are almost identical.
Here is the code I'm trying to use:
          RMIRemoteSessionController controller = (RMIRemoteSessionController)Naming.lookup(registryName);
          RemoteConnection connection = new RMIConnection(controller);
          CacheSynchronizationManager syncMgr = new CacheSynchronizationManager();
          serverSession.setCacheSynchronizationManager(syncMgr);
          serverSession.getCacheSynchronizationManager().addRemoteConnection(connection);
Here is the stack trace I'm seeing:
18:53:01,146 DEBUG OEDataEntry - OEDataEntry - - EXCEPTION [TOPLINK-0] (3.6.2 JDK1.2): TOPLink.Public.Remote.CommunicationException
18:53:01,146 DEBUG OEDataEntry - OEDataEntry - - EXCEPTION DESCRIPTION: Error Sending connection service to
18:53:01,156 DEBUG OEDataEntry - OEDataEntry - - INTERNAL EXCEPTION: java.lang.ClassCastException
18:53:01,166 DEBUG OEDataEntry - OEDataEntry - -      at TOPLink.Public.Remote.CacheSynchronizationManager.addRemoteConnectionForSynchronization(CacheSynchronizationManager.java:84)
18:53:01,166 DEBUG OEDataEntry - OEDataEntry - -      at TOPLink.Public.Remote.CacheSynchronizationManager.addRemoteConnection(CacheSynchronizationManager.java:68)

Also, if someone could provide me with a complete example of how to implement distributed cache synchronization via RMI that would be helpful too, the docs are very sparse on this.
Basically what I'm trying to do is this: I have a web application that uses toplink to connect to a database. I have a separate application that also uses toplink to connecto the database that runs outside the application. The external app can update tables that the web application uses, I would like the web application to have it's cache updated when the external app changes something in those tables. It is my understanding that this is what distributed cache synchronization is for. How do I use it?

Similar Messages

  • Error handling for distributed cache synchronization

    Hello,
    Can somebody explain to me how the error handling works for the distributed cache synchronization ?
    Say I have four nodes of a weblogic cluster and 4 different sessions on each one of those nodes.
    On Node A an update happens on object B. This update is going to be propogated to all the other nodes B, C, D. But for some reason the connection between node A and node B is lost.
    In the following xml
    <cache-synchronization-manager>
    <clustering-service>...</clustering-service>
    <should-remove-connection-on-error>true</should-remove-connection-on-error>
    If I set this to true does this mean that the Toplink will stop sending updates from node A to node B ? I presume all of this is transparent. In order to handle any errors I do not have to write any code to capture this kind of error .
    Is that correct ?
    Aswin.

    This "should-remove-connection-on-error" option mainly applies to RMI or RMI_IIOP cache synchronization. If you use JMS for cache synchronization, then connectivity and error handling is provided by the JMS service.
    For RMI, when this is set to true (which is the default) if a communication exception occurs in sending the cache synchronization to a server, that server will be removed and no longer synchronized with. The assumption is that the server has gone down, and when it comes back up it will rejoin the cluster and reconnect to this server and resume synchronization. Since it will have an empty cache when it starts back up, it will not have missed anything.
    You do not have to perform any error handling, however if you wish to handle cache synchronization errors you can use a TopLink Session ExceptionHandler. Any cache synchronization errors will be sent to the session's exception handler and allow it to handle the error or be notified of the error. Any errors will also be logged to the TopLink session's log.

  • Distributed Cache synchronization with JMS

    Hello,
    The documentation on Cache Synchronization using JMS lists steps to setting up JMS in the JMSClusteringService but does not list steps as to how to connect or setup connections to the various different servers inorder to synchronize between them. It lists steps for connecting to servers when using RMI but not JMS. Appreciate any additional documentation on doing this in JMS. Many thanks

    JMS, by its nature, provides the connections between the different 'servers'. If all servers connect to the same JMS service then there are no additional actions required to have the 'servers' synchronize.
    --Gordon                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • JMS Cache Synchronization Manager

    Hi all,
    I am trying to implement distributed cache synchronization in TopLink using JMS.
    On http://download-west.oracle.com/docs/cd/A97688_12/toplink.903/b10064/enterpri.htm#1022254 , there is an example given which has a snippet of the sessions.xml file.
    The example snippet shows a tag <naming-service-initial-context-factory> under the <cache-synchronization-manager> tag. But on the DTD given on http://download-west.oracle.com/docs/cd/A97688_12/toplink.903/b10064/a-sessio.htm#634251 , I cant find an element <naming-service-initial-context-factory>. Please let me know which one is wrong - the DTD or the example?
    Also, I tried to use JMS for distributed cache synchronization. My JMS Server is running on a seperate VM and I have configured info about it in the sessions.xml file. But TopLink is complaining that it cannot find the top and connection factory. Yet, I am able to look them up from a standalone program.
    Does anyone have any experience setting this up? Any examples?
    Thanks,
    Binil

    Hi Doug,
    Thanks for the clarifications! :)
    I am not able to get the JMS Cache Synchronization work still :( I am new to JMS & Toplink - so I will try to explain what I am doing and please let me know if there is something I am doing wrong.
    I have an EJB application which is a Stateless Session bean which has two methods : one to fetch an entity and another to update an entity. Also, I have a weblogic domain in which I have three managed servers - appServerOne, appServerTwo and jmsServer. On appServerOne and appServerTwo I have deployed the above mentioined application. On jmsServer, I have configured my ConnectionFactory and Topic and the JNDI names of those are provided to the EJB application.
    With this setup, I run two client programs. I will list the steps below:
    1. Client1 fetches an entity whereby it is loaded to the TopLink cache. The DB logs show that a SELECT query is issued to the DB.
    2. Client2 fetches the same entity whereby it is loaded to the cache; again a SELECT query is issued.
    3. Client1 updates that entity using UOW; the logs dont show a DB UPDATE statement though. But the updates are indeed made to the DB when I check them.
    4. Client1 fetches the entity again; the updates are visible and the JDBC logs show that a trip to the DB is not done.
    5. After waiting for sometime Client1 fetches the same entity again and I get the stale data! :(
    I have enabled logging, so I am hoping that TopLink will log a message when a JMS notification is posted. Also, I have made the cache synchronization synchronous, so that the transaction shouldnt commit before the notification being send.
    I tried making the stateless session bean stateful and it still didnt work. Is there anything I need to do.
    Cheerio,
    Binil

  • Distributed cache performance?

    Hi,
    I have a question about the performance of a cluster using a distributed cache:
    A distributed cache is available in the the cluster, using the expiry-delay functionality. Each node first inserts new entries in the cache and then periodically updates the entries as long as the entry is needed in the cluster (entries that are no longer periodically updated will be removed due to the expiry-delay).
    I performed a small test using a cluster with two nodes that each inserted ~2000 entries in the distributed cache. The nodes then periodically update their entries at 5 minutes intervals (using the Map.put(key, value) method). The nodes never access the same entries, so there will be no synchronization issues.
    The problem is that the CPU load on the machines running the nodes are very high, ~70% (and this is quite powerful machines with 4 CPUs running Linux). To be able to find the reason for the high CPU load, I used a profiler tool on the application running on one of the nodes. It showed that the application spent ~70% of the time in com.tangosol.coherence.component.net.socket.UdpSocket.receive. Is this normal?
    Since each node has a lot of other things to do, it is not acceptable that 70% of the CPU is used only for this purpose. Can this be a cache configuration issue, or do I have to find some other approach to perform this task?
    Regards
    Andreas

    Hi Andreas,
    Can you provide us with some additional information. You can e-mail it to our support account.
    - JProfiler snapshot of the profiling showing high CPU utilization
    - multiple full thread dumps for the process taken a few seconds apart, these should be taken when running outside of the profiler
    - Your override file (tangosol-coherence-override.xml)
    - Your cache configuration file (coherence-cache-config.xml)
    - logs from the high CPU event, please also include -verbose:gc in the logs, directing the output to the coherence log file
    - estimates on the sizes of the objects being updated in the cache
    As this is occurring even when you are not actively adding data to the cache, can you describe what else your application is doing at this time. It would be extremely odd for Coherence to consume any noticeable amount of CPU if you are not making heavy use of the cache.
    Note that when using the Map.put method the old value is returned to the caller, which for a distributed cache means extra network load, you may wish to consider switching to Map.putAll() as this does not need to return the old value, and is more efficient even if you are only operating on a single entry.
    thanks,
    Mark

  • Distributed Cache service stuck in Starting Provisioning

    Hello,
    I'm having problem with starting/stopping Distributed Cache service in one of the SharePoint 2013 farm servers. Initially, Distributed Cache was enabled in all the farm servers by default and it was running as a cluster. I wanted to remove it from all hosts
    but one (APP server) using below PowerShell commands, which worked fine.
    Stop-SPDistributedCacheServiceInstance -Graceful
    Remove-SPDistributedCacheServiceInstance
    But later I attempted to add the service back to two hosts (WFE servers) using below command and unfortunately one of them got stuck in the process. When I look at the Services on Server from Central Admin, the status says "Starting".
    Add-SPDistributedCacheServiceInstance
    Also, when I execute below script, the status says "Provisioning".
    Get-SPServiceInstance | ? {($_.service.tostring()) -eq "SPDistributedCacheService Name=AppFabricCachingService"} | select Server, Status
    I get "cacheHostInfo is null" error when I use "Stop-SPDistributedCacheServiceInstance -Graceful".
    I tried below script,
    $instanceName ="SPDistributedCacheService Name=AppFabricCachingService" 
    $serviceInstance = Get-SPServiceInstance | ? {($_.service.tostring()) -eq $instanceName -and ($_.server.name) -eq $env:computername}
    $serviceInstance.Unprovision()
    $serviceInstance.Delete()
    ,but it didn't work either, and I got below error.
    "SPDistributedCacheServiceInstance", could not be deleted because other objects depend on it.  Update all of these dependants to point to null or 
    different objects and retry this operation.  The dependant objects are as follows: 
    SPServiceInstanceJobDefinition Name=job-service-instance-{GUID}
    Has anyone come across this issue? I would appreciate any help.
    Thanks!

    Hi ,
    Are you able to ping the server that is already running Distributed Cache on this server? For example:
    ping WFE01
    As you are using more than one cache host in your server farm, you must configure the first cache host running the Distributed Cache service to allow Inbound ICMP (ICMPv4) traffic through the firewall.If an administrator removes the first cache host from
    the cluster which was configured to allow Inbound ICMP (ICMPv4) traffic through the firewall, you must configure the first server of the new cluster to allow Inbound ICMP (ICMPv4) traffic through the firewall. 
    You can create a rule to allow the incoming port.
    For more information, you can refer to the  blog:
    http://habaneroconsulting.com/insights/Distributed-Cache-Needs-Ping#.U4_nmPm1a3A
    Thanks,
    Eric
    Forum Support
    Please remember to mark the replies as answers
    if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]
    Eric Tao
    TechNet Community Support

  • How can i configure Distributed cache servers and front-end servers for Streamlined topology in share point 2013??

    my question is regarding SharePoint 2013 Farm topology. if i want go with Streamlined topology and having (2 distribute cache and Rm servers+ 2 front-end servers+ 2 batch-processing servers+ cluster sql server) then how distributed servers will
    be connecting to front end servers? Can i use windows 2012 NLB feature? if i use NLB and then do i need to install NLB to all distributed servers and front-end servers and split-out services? What will be the configuration regarding my scenario.
    Thanks in Advanced!

    For the Distributed Cache servers, you simply make them farm members (like any other SharePoint servers) and turn on the Distributed Cache service (while making sure it is disabled on all other farm members). Then, validate no other services (except for
    the Foundation Web service due to ease of solution management) is enabled on the DC servers and no end user requests or crawl requests are being routed to the DC servers. You do not need/use NLB for DC.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • Foundation 2013 Farm and Distributed Cache settings

    We are on a 3 tier farm - 1 WFE + 1APP + 1SQL - have had many issues with AppFab and Dist Cache; and an additional issue with noderunner/Search Services.  Memory and CPU running very high.  Read that we shouldn't be running Search
    and Dist Cache in the same server, nor using a WFE as a cache host.  I don't have the budget to add another server in my environment. 
    I found an article (IderaWP_CachingFormSharePointPerformance.pdf) saying "To make use of SharePoint's caching capabilities requires a Server version of the platform." because it requires the publishing feature, which Foundation doesn't have. 
    So, I removed Distributed Cache (using Powershell) from my deployment and disabled the AppFab.  This resolved 90% of server errors but performance didn't improve. Now, not only I'm getting errors now on Central Admin. - expects Dist Cache
    - but I'm getting disk operations reading of 4000 ms.
    Questions:
    1) Should I enable AppFab and disable cache?
    2) Does Foundation support Dist Cache?  Do I need to run Distributed Cache?
    3) If so, can I run with just 1 cache host?  If I shouldn't run it on a WFE or an App server with Search, do I have to stop Search all together?  What happens with 2 tier farms out there? 
    4) Reading through the labyrinth of links on TechNet and MSDN on the subject, most of them says "Applies to SharePoint Server".
    5) Anyone out there on a Foundation 2013 production environment that could share your experience?
    Thanks in advance for any help with this!
    Monica
    Monica

    That article is referring to BlobCache, not Distributed Cache. BlobCache requires Publishing, hence Server, but DistributedCache is required on all SharePoint 2013 farms, regardless of edition.
    I would leave your DistCache on the WFE, given the App Server likely runs Search. Make sure you install
    AppFabric CU5 and make sure you make the changes as noted in the KB for
    AppFabric CU3.
    You'll need to separately investigate your disk performance issues. Could be poor disk layout, under spec'ed disks, and so on. A detail into the disks that support SharePoint would be valuable (type, kind, RPM if applicable, LUNs in place, etc.).
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • Limitation on number of objects in distributed cache

    Hi,
    Is there a limitation on the number (or total size) of objects in a distributed cache? I am seeing a big increase in response time when the number of objects exceeds 16,000. Normally, the ServiceMBean.RequestAverageDuration value is in the 6-8ms range as long as the number of objects in the cache is less than 16K - I've run our application for weeks at a time without seeing any problems. However, once the number of objects exceeds the magic number of 16K the average request duration almost immediately jumps to over 100ms and continues to climb as more objects are added.
    I'm fairly confident that the cache is indexed properly (as Dimitri helped us with that). Are there any configuration changes that could possibly help out here? We are using Coherence 3.3.
    Any suggestions would be greatly appreciated.
    Thanks,
    Jim

    Hi Jim,
    The results from the load test look quite normal, the system fairly quickly stabilizes at a particular performance level and remains there for the duration of the test. In terms of latency results, we see that the cache.putAll operations are taking ~45ms per bulk operation where each operation is putting 100 1K items, for cache.getAll operations we see about ~15ms per bulk operation. Additionally note that the test runs over 256,000 items, so it is well beyond the 16,000 limit you've encountered.
    So it looks like your application are exhibiting different behavior then this test. You may wish to try to configure this test to behave as similarly to yours as possible. For instance you can set the size of the cache to just over/under 16,000 using the -entries parameter, set the size of the entries to 900 bytes using the -size parameter, and set the total number of threads per worker using the -threads parameter.
    What is quite interesting is that at 256,000 1K objects the latency measured with this test is apparently less then half the latency you are seeing with a much smaller cache size. This would seem to point at the issue being related to or rooted in your test. Would you be able to provide a more detailed description of how you are using the cache, and the types of operations you are performing.
    thanks,
    mark

  • Error message when using a MessageListener using a distributed cache

    Hi --
    I'm getting the following error message when I attach a message listener to a distributed cache. I get the same message if I attach the listener to the NearCache in front of the DistributedCache, or to the DistributedCache itself.
    My message listener listens for a create() operation and writes the created value out to the database. Both the key and value are java objects that are getting "serialized" when they're pushed in the cache. The listener is never called.
    The error spits out two messages, which look like:
    2003-04-07 21:48:05.281 Tangosol Coherence 2.1/239 <Error> (thread=DistributedCache:EventDispatcher): An exception occurred while dispatching this event:
    CacheEvent: MapEvent{com.tangosol.coherence.component.util.daemon.queueProcessor
    .service.DistributedCache$BinaryMap added: key=Binary(length=269, value=0x0005AC
    ED000573720021636F6D2E6F6C742E646174612E696E7465726E616C2E4461746162617365554944
    6FABB5383C6013B402000078720021636F6D2E6F6C742E646174612E696E7465726E616C2E416273
    7472616374554944D04F591196E4DC1B0200024C000D657874656E73696F6E4461746174000F4C6A
    6176612F7574696C2F4D61703B4C0009756964537472696E677400124C6A6176612F6C616E672F53
    7472696E673B7870737200116A6176612E7574696C2E486173684D61700507DAC1C31660D1030002
    46000A6C6F6164466163746F724900097468726573686F6C6478703F400000000000087708000000
    0B0000000078740011363930395F436F6D706F6E656E74426964), value=Binary(length=1069,
    value=0x0005ACED000573720026636F6D2E6562726576696174652E61756374696F6E2E6269642
    E436F6D706F6E656E744269648EC95C4DE33A88D802000D5A0007626573744269644A000B6269645
    3657175656E6365440004636F73745A0007696E697469616C5A00066E65774269645A00067469654
    2696444000576616C75654C000B61756374696F6E4D6F64657400294C636F6D2F656272657669617
    4652F61756374696F6E2F6576656E742F41756374696F6E4D6F64653B4C000A61756374696F6E554
    9447400124C636F6D2F6F6C742F646174612F5549443B4C000A636F6D70616E7955494471007E000
    24C000C636F6D706F6E656E7455494471007E00024C000A737472696E67436F73747400124C6A617
    6612F6C616E672F537472696E673B4C000B737472696E6756616C756571007E00037872002D636F6
    D2E6562726576696174652E636F6D6D6F6E2E416273747261637450657273697374656E744F626A6
    56374497E2729A24CA5790200034C000A637265617465446174657400104C6A6176612F7574696C2
    F446174653B4C000375696471007E00024C000A7570646174654461746571007E000578707372000
    E6A6176612E7574696C2E44617465686A81014B59741903000078707708000000F46B9A286278737
    20021636F6D2E6F6C742E646174612E696E7465726E616C2E44617461626173655549446FABB5383
    C6013B402000078720021636F6D2E6F6C742E646174612E696E7465726E616C2E416273747261637
    4554944D04F591196E4DC1B0200024C000D657874656E73696F6E4461746174000F4C6A6176612F7
    574696C2F4D61703B4C0009756964537472696E6771007E00037870737200116A6176612E7574696
    C2E486173684D61700507DAC1C31660D103000246000A6C6F6164466163746F72490009746872657
    3686F6C6478703F4000000000000877080000000B0000000078740011363930395F436F6D706F6E6
    56E744269647371007E00077708000000F46B9A286278000000000000000000402E0000000000000
    00000402E00000000000073720027636F6D2E6562726576696174652E61756374696F6E2E6576656
    E742E41756374696F6E4D6F6465BD0C9E245C328B4F02000078720029636F6D2E656272657669617
    4652E636F6D6D6F6E2E41627374726163745479706553616665456E756D506D8C41B0144DB302000
    249000A696E744C69746572616C4C000D737472696E674C69746572616C71007E000378700000000
    374000A50524F44554354494F4E7371007E00097371007E000D3F4000000000000877080000000B0
    00000007874000A38335F41756374696F6E7371007E00097371007E000D3F4000000000000877080
    000000B000000007874000A34325F436F6D70616E797371007E00097371007E000D3F40000000000
    00877080000000B00000000787400103131315F426964436F6D706F6E656E747070)}
    2003-04-07 21:48:05.687 Tangosol Coherence 2.1/239 <Warning> (thread=CoherenceLogger): Asynchronous logging character limit exceeded; discarding 3 log messages (lines=17, chars=1416)

    Kris,
    First of all you should increase the value of logging-config/character-limit element in tangosol-coherence.xml to see the message entirely. The default setting is 4096 which is not enough to see your exception text.
    When you do that I believe you will see that the actual exception is java.lang.ClassNotFoundException indicating that the node that has the listener installed doesn't know about the class that is being put into the cache and could be easily fixed as shown here: http://www.tangosol.com/faq-coherence.jsp#classnotfound
    Please let me know if that doesn't help.
    Gene

  • Distributed cache

    HI,
    We have a server (Server 1), on which the status of the Distributed cache was in "Error Starting" state.
    While applying a service pack due to some issue we were unable to apply the path (Server 1) so we decided to remove the effected server from the farm and work on it. the effected server (Server 1) was removed from the farm through the configuration wizard.
    Even after running the configuration wizard we were still able to see the server (Server 1) on the SharePoint central admin site (Servers in farm) when clicked, the service "Distributed cache" was still visible with a status "Error Starting",
    tried deleting the server from the farm and got an error message, the ULS logs displayed the below.
    A failure occurred in SPDistributedCacheServiceInstance::UnprovisionInternal. cacheHostInfo is null for host 'servername'.
    8130ae9c-e52e-80d7-aef7-ead5fa0bc999
    A failure occurred SPDistributedCacheServiceInstance::UnprovisionInternal()... isGraceFulShutDown 'False' , isGraceFulShutDown, Exception 'System.InvalidOperationException: cacheHostInfo is null     at Microsoft.SharePoint.DistributedCaching.Utilities.SPDistributedCacheServiceInstance.UnProvisionInternal(Boolean
    isGraceFulShutDown)'
    8130ae9c-e52e-80d7-aef7-ead5fa0bc999
    A failure occurred SPDistributedCacheServiceInstance::UnProvision() , Exception 'System.InvalidOperationException: cacheHostInfo is null     at Microsoft.SharePoint.DistributedCaching.Utilities.SPDistributedCacheServiceInstance.UnProvisionInternal(Boolean
    isGraceFulShutDown)     at Microsoft.SharePoint.DistributedCaching.Utilities.SPDistributedCacheServiceInstance.Unprovision()'
    8130ae9c-e52e-80d7-aef7-ead5fa0bc999
    We are unable to perform any operation install/repair of SharePoint on the effected server (Server 1), as the server is no longer in the farm, we are unable to run any powershell commands.
    Questions:-
    What would cause that to happen?
    Is there a way to resolve this issue? (please provide the steps)
    Satyam

    Hi
    try this:
    http://edsitonline.com/2014/03/27/unexpected-exception-in-feedcacheservice-isrepopulationneeded-unable-to-create-a-datacache-spdistributedcache-is-probably-down/
    Hope this helps. Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Set request timeout for distributed cache

    Hi,
    Coherence provides 3 parameters we can tune for the distributed cache
    tangosol.coherence.distributed.request.timeout      The default client request timeout for distributed cache services
    tangosol.coherence.distributed.task.timeout      The default server execution timeout for distributed cache services
    tangosol.coherence.distributed.task.hung      the default time before a thread is reported as hung by distributed cache services
    It seems these timeout values are used for both system activities (node discovery, data re-balance etc.) and user activities (get, put). We would like to set the request timeout for get/put. But a low threshold like 10 ms sometimes causes the system activities to fail. Is there a way for us to separately set the timeout values? Or even is it possible to setup timeout on individual calls (like get(key, timeout))?
    -thanks

    Hi,
    not necessarily for get and put methods, but for queries, entry-processor and entry-aggregator and invocable agent sending, you can make the sent filter or aggregator or entry-processor or agent implement PriorityTask, which allows you to make QoS expectations known to Coherence. Most or all stock aggregators and entry-processors implement PriorityTask, if I correctly remember.
    For more info, look at the documentation of PriorityTask.
    Best regards,
    Robert

  • Cache Synchronization with JMS and a Message Driven Bean (MDB)

    If I understand correctly, Toplink ueses the following configuration info to find the target to publish its session messages to a JMS server (having its URL as below) which provides the JNDI service that Toplink needs to look up the topic:
    <cache-synchronization-manager>
    <clustering-service> oracle.toplink.remote.jms.mdb.JMSPublishingOnlyClusteringService
    </clustering-service>
    <should-remove-connection-on-error>false</should-remove-connection-on-error>
    <!-- both of the following tags are user specified and must correspond to -->
    <!-- the settings that the user has made, manually, to the JMS Service -->
    <jms-topic-connection-factory-name> jms/TopLinkTopicConectionFactory
    </jms-topic-connection-factory-name>
    <jms-topic-name>jms/TopLinkCacheSynchTopic</jms-topic-name>
    <!-- both of the following tags will be required if OracleAS TopLink -->
    <!-- is not running in the same JVM as the JNDI service that is hosting the JMS Topic -->
    <naming-service-url>ormi://localhost:23791</naming-service-url>
    <naming-service-initial-context-factory> com.evermind.server.rmi.RMIInitialContextFactory </naming-service-initial-context-factory></cache-synchronization-manager>
    The MDB also uses the same JNDI service provided by the JMS server to listen to the topic which is named in the ejb-jar.xml file:
    <enterprise-beans>
    <message-driven>
    <display-name>TopLink clustering MDB</display-name>
    <ejb-name>TopLinkClusteringMDB</ejb-name>
    <ejb-class>com.mycompany.mdb.ClusteringMDB</ejb-class>
    <transaction-type>Container</transaction-type>
    <message-driven-destination> <destination-type>javax.jms.Topic</destination-type>
    </message-driven-destination>
    <env-entry>
    <description>TopLink session name</description>
    <env-entry-name>tl_session_name_for_mdb</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>Employee_Session</env-entry-value>
    </env-entry>
    <resource-ref> <description>description</description>
    <res-ref-name>jms/TopLinkTopicConectionFactory</res-ref-name>
    <res-type>javax.jms.TopicConnectionFactory</res-type>
    <res-auth>Application</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
    <resource-env-ref>
    <resource-env-ref-name> jms/TopLinkCacheSynchTopic</resource-env-ref-name>
    <resource-env-ref-type>javax.jms.Topic</resource-env-ref-type> </resource-env-ref>
    </message-driven></enterprise-beans>
    To do this, the EJB container that hosts the above MDB needs to be configured to know where the JMS server is by using the above URL same as in the Toplink sessions.xml file.
    I am not clear that who provides the JNDI service for the Toplink session name lookup used by the MDB:
    // Obtain the Session name configured in the environment variable
    String sessionName = (String) myEnv.lookup(TOPLINK_SESSION_NAME);
    session = SessionManager.getManager().getSession(sessionName);
    so that the MDB can find the currently running Toplink session and communicate with it.
    Can anybody help answer my above question and correct my understandings?
    Many thanks!

    Although TopLink is running in the application server’s VM, the only notable integration points with the server are for JTA and user-defined data sources. All of the work performed to get a session via SessionManager occurs solely within TopLink. When the call is made to retrieve a session, you aren’t getting the ‘active’ session identified by “Employee_Session” that is registered with the application server, rather a new session is created using the definition that exists for “Employee_Session” in sessions.xml.
    When the call ‘session = SessionManager.getManager().getSession(“Employee_Session”)’ is made, the SessionManager simply looks for sessions.xml at the root level of its deployed jars or classpath, then looks for the “Employee_Session” tag within sessions.xml. If a session exists in the file with that name then a TopLink session object is created and returned.
    Note that setting an environment entry as mentioned above simply allows for the session name to be declared dynamically. The call to ‘myEnv.lookup(“tl_session_name_for_mdb”)’ simply asks the bean’s environment for the <env-entry-value> that matches the <env-entry-name>. That string is then used in SessionManager (no different than a hard coded value would be) to identify the session in sessions.xml that is to be loaded.
    I hope this makes sense.

  • High-units reflect twice the amount with dual JVM's in a distributed cache

    HI all,
    I have a question - i have a near cache scheme defined - running 4 JVM's with my application deployed to it (localstorage=false) - and 2 JVM's for the distributed cache (localstorage=true)
    The high-units is set to 2000 - but the cache is allowing 4000. Is this b/c each JVM will allow for 2000 high-units each?
    I was under the impression that as long as coherence is running in the same multi-cast address and port - that the total high-units would be 2000 not 4000.
    Thanks...

    user644269 wrote:
    HI all,
    I have a question - i have a near cache scheme defined - running 4 JVM's with my application deployed to it (localstorage=false) - and 2 JVM's for the distributed cache (localstorage=true)
    The high-units is set to 2000 - but the cache is allowing 4000. Is this b/c each JVM will allow for 2000 high-units each?
    I was under the impression that as long as coherence is running in the same multi-cast address and port - that the total high-units would be 2000 not 4000.
    Thanks...Hi,
    the high-unit setting is per-backing map, so in your case it means 2000 units per storage-enabled nodes.
    From 3.5 it will become a bit more complex with the partition aware backing maps.
    Best regards,
    Robert

  • More Control of Cache Synchronization in a Cluster?

    If I understand correctly, the cache synchronization manager, by default, sends out a changeSet message to the network for any UOW write commit. Since I have a control on certain objects not using Toplink’s cache, I actually do not need the cache synchronization manger to broadcast any update on these objects. In other words, I do not want the cache synchronization manger to send out the changeSet message to the network if I only update those objects that are configured to always read from the database. In this way, I may be able to avoid some unnecessary changeSet message propagations.
    My question is that whether I have a way, either in sessions.xml or in Java API, to tell the cache synchronization manger not to send out the changeSet message for a given specific UOW write commit (although I still need the data update to be committed to the database).

    Many thanks for the reply and glad to see something better is on the way again!
    If I choose to set the cache synchronization manager to null, do the UOW write for a given class which is always refreshed from the database, and then reset the cache synchronization manger back to the previous instance, do I need to do the following afterwards:
              // must login/re-login to initialize cache synchronization
              if (session.isConnected()) {
                   session.logout();
              session.login();
    to ensure the manager be reset properly?
    Since the propagation of the changeSet message is triggered by the UOW, can I have more control at the UOW level to turn on/off the cache synchronization manager?
    If I understand correctly, in Toplink 10.1.3, I can configure the cache synchronization manger globally at the session level, and also have the option in the same application to set a given number of classes not be cache synchronized in a cluster at the descriptor level to overrule the session global settings. I should not have to choose one over the other. Once these are done in configurations, what is the reason that I still have to choose either to send the changeSet or to invalidate the message?

Maybe you are looking for