Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Unable to use cache coordination
Unable to use cache coordination [message #1863924] Wed, 06 March 2024 15:06 Go to next message
Gonçalo Bernardo is currently offline Gonçalo BernardoFriend
Messages: 2
Registered: March 2024
Junior Member
Hello,

Our application is migrating to a clustered environment and we decided to use EclipseLink's cache coordination to avoid stale cache info,
but unfortunately we are not succeeding in enabling it, or even seeing any information about what EclipseLink is doing when it comes to caching.

In our environment we are using WebSphere Application Server v8.5. Our applications are using JDK 1.8 and EclipseLink 2.6.4, and inside our application, we make requests to the database using UnitOfWork.

We've tried using both RMI and JMS (also with an MDB and "jms-publishing" for the protocol property) for the communication protocol. In the case of JMS we were able to publish and subscribe to the topic we created for the coordination with a couple of small test clients, so we know that the topic was working properly, but we haven't been able to see the same with EclipseLink.

When we enable all logging in the persistence.xml (<property name="eclipselink.logging.level" value="FINEST"/>), we only see logs referring to queries, but nothing related to caching - here's an example:
[EL Fine]: sql: 2024-03-06 13:08:42.095--ClientSession(-314095039)--Connection(-259747298)--Thread(Thread[ORB.thread.pool : 0,5,main])--SELECT ...


We've tried many variations of persistence.xml configurations, but here's the latest example:
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http:://java.sun.com/xml/ns/persistence" version="2.0">
    <persistence-unit name="persistenceUnit">
        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
        <exclude-unlisted-classes>false</exclude-unlisted-classes>
        <properties>
            <property name="eclipselink.descriptor-event-listener" value="com.server.tm.adapter.external.persistence.DescriptorEventListener"/>
            <!-- Adding cache coordination properties -->
            <property name="eclipselink.cache.coordination.protocol" value="jms"/>
            <property name="eclipselink.cache.coordination.jms.host" value="iiop://host:port1, iiop//host:port2"/>
            <property name="eclipselink.cache.coordination.jms.topic" value="CacheTopic"/>
            <property name="eclipselink.cache.coordination.jms.factory" value="CacheTopicFactory"/>
            <property name="eclipselink.logging.level" value="FINE"/>
            <property name="eclipselink.logging.level.cache" value="FINEST"/>
        </properties>
    </persistence-unit>
</persistence>


At this point we're wondering if there's something outside of the context of cache coordination that we need to configure that we may have missed, because it feels like we've tried all alternatives proposed by EclipseLink's documentation.

Thank you in advance for any assistance you can provide.
Re: Unable to use cache coordination [message #1863929 is a reply to message #1863924] Wed, 06 March 2024 20:25 Go to previous messageGo to next message
Radek Felcman is currently offline Radek FelcmanFriend
Messages: 19
Registered: March 2021
Junior Member
Sorry I don't have experience with WebSphere AS but is it this
iiop://host:port1, iiop//host:port2
valid URL? I'd like expect
iiop://host:port1
only?
Does it work with
new javax.naming.InitialContext
in pure Java JMS client?

Similary in case of
CacheTopic/CacheTopicFactory
there is expected JNDI name. Usually something like
jms/EclipseLinkTopic
with `jms/` "folder" is there. Are You sure that Your JMS Topic and JMS TopicFactory are published with these remote names?
Re: Unable to use cache coordination [message #1863939 is a reply to message #1863929] Thu, 07 March 2024 10:06 Go to previous message
Gonçalo Bernardo is currently offline Gonçalo BernardoFriend
Messages: 2
Registered: March 2024
Junior Member
Hi, thanks for the quick reply.

To be honest the double URL was mostly a shot in the dark, the idea was that while our application instances are on the same host, they are assigned different ports, so we tried using this format. We had also tried using a single URL before, or no URL property at all, but neither worked.

About the topic and factory properties, it was my understanding that the "jms/" was just a convention rather than a requirement (though I'm aware almost all examples online use this convention). I just double checked our WAS configuration again and their JNDI names match what is in the persistence.xml, without the "/jms".

About your InitialContext point, I'm not sure I understand. Could you please expand further?
Previous Topic:UCP connection labelling callback in eclipse link jpa
Next Topic:How to generate Metamodel classes with maven
Goto Forum:
  


Current Time: Sun Apr 28 02:02:59 GMT 2024

Powered by FUDForum. Page generated in 0.03098 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top