Skip to main content

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

All of the JPA 2.0 functionality can be configured through EclipseLink-specific API.

Take a look at the @CacheAnnotation.  It has an expiry.

Alternately, you can use a Customizer to get at the native EclipseLink API.

http://wiki.eclipse.org/Using_EclipseLink_JPA_Extensions_%28ELUG%29#Using_EclipseLink_JPA_Extensions_for_Customization_and_Optimization

-Tom



On 14/11/2011 1:03 PM, Varga Daniel (KIRF 65) wrote:
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 2^nd 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



_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top