Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [eclipselink-users] Configuring Cache for Objects inPersistence.xml

You cannot currently configure all of the cache setting (or other mapping
settings) in XML.  This is something we are working on for EclipseLink 1.0,
through introducing an extended orm.xml:

Currently you can use a EclipseLink sessions.xml and project.xml to define
any extended EclipseLink settings in XML.  You set your sessions.xml using
the persistence.xml "eclipselink.sessions-xml" and
"eclipselink.session-name" properties.  However these XML files do not
integrate with existing JPA annotations nor default (you must fully specify
everything in the project XML).  Once the Mapping Workbench is contributed
to EclipseLink, you should be able to generate these files using the Mapping
Workbench UI.

Another option is to use a DescriptorCustomizer to added these cache
settings through code.  You can reference the DescriptorCustomizer in your

Vespa, Anthony J wrote:
> Hrm,  Okie I think this is close to what I need, ecept that, the
> annotation has:
> @Cache(
>         type = org.eclipse.persistence.annotations.CacheType.HARD_WEAK,
>         isolated = false,
>         expiry = 600000,
>         alwaysRefresh = false,
>         disableHits = false,
>         coordinationType =
> org.eclipse.persistence.annotations.CacheCoordinationType.INVALIDATE_CHA
> )
> So can I set coordination, always refresh, expired etc as properties?
> It doesn't look like I can - it only seems I can set
> eclipselink.cache.type.ENTITY
> eclipselink.cache.size.ENTITY
> eclipselink.cache.shared.ENTITY
> I'd prefer to have all the annotation settings in the persistence.xml,
> like coordination type, expiry etc.  Is this possible?
> -T
> -----Original Message-----
> From: eclipselink-users-bounces@xxxxxxxxxxx
> [mailto:eclipselink-users-bounces@xxxxxxxxxxx] On Behalf Of Doug Clarke
> Sent: Friday, December 14, 2007 5:00 PM
> To: EclipseLink User Discussions
> Subject: RE: [eclipselink-users] Configuring Cache for Objects
> inPersistence.xml
> Sure enough right after sending it I find the right EclipseLink link:
> to_Use_the_Persistence_Unit_Properties_for_Caching
> Doug
> -----Original Message-----
> From: eclipselink-users-bounces@xxxxxxxxxxx
> [mailto:eclipselink-users-bounces@xxxxxxxxxxx]On Behalf Of Vespa,
> Anthony J
> Sent: Friday, December 14, 2007 4:38 PM
> To: EclipseLink User Discussions
> Subject: [eclipselink-users] Configuring Cache for Objects in
> Persistence.xml
> Hello,
> I've currently set up my objects using the various @cache notation
> settings.  Is it possible to centralize these settings for each object
> into one .xml file. Like my persistence.xml?  I looked through the docs
> and can't quite find how to do it (except for global settings)
> Thanks for any help!
> -Tony

--- James Sutherland Oracle TopLink ,
 EclipseLink , TopLink
Wiki: Java Persistence , EclipseLink 
Forums: TopLink , EclipseLink , Glassfish
View this message in context:
Sent from the EclipseLink - Users mailing list archive at

Back to the top