Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] shared cache issues

Hi,

 

I have a very odd situation related to shared cache.

It’s oddity is rooted in my configuration:

-       The weblogic appserver we use only supports the JPA 1 api, while

-       The persistence provider is eclipselink 2.2.0 (JPA 2)

Therefore one cannot configure JPA 2 features (such as shared cache) either with annotations or with the standard tags of persistence.xml.

So I can only configure the cache with the properties in the persistence.xml, which looks the following now:

 

                        <properties>

                                    <property name="eclipselink.cache.shared.default" value="true"/>

                                    <property name="eclipselink.cache.type.default" value="Weak"/>

                                    …

                        </properties>

 

In production the application is deployed to 2 tracks, that leads to problems when there is 2nd level cache that is nor distributed neither coordinated.

Switching off the cache with the “eclipselink.cache.shared.default” property does not help unfortunately, because then I’ll end up lazy properties fetched eagerly that slows the application incredibly down.

So to increase the likelihood of an object to be evicted from the cache I switched the type to Weak, however one cannot rely on it.

 

I’d like to have a more predictable eviction policy configured, i.e. a timeout to evict it in every 60 seconds. The only problem is that I cannot find such a property in the documentation. Do you have any idea how to do that when you cannot use jpa 2 annitations.

 

Thanks a lot,

Daniel

 


Back to the top