Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » @Cache annotations set for the entire Peristence Unit(Is there anyway to set up @Cache(coordinationType defaults for all Entities in the persistence.xml)
@Cache annotations set for the entire Peristence Unit [message #684456] Wed, 15 June 2011 15:46 Go to next message
J F is currently offline J F
Messages: 242
Registered: July 2009
Senior Member
I wish to be able to set @Cache(coordinationType=CacheCoordinationType.XXX) for all entities by default.
Is there anyway to do this in the persistence.xml file for the Persistence Unit. If not can it be done through a sessions.xml/project.xml/SessionCustomizer?

Thanks.
Re: @Cache annotations set for the entire Peristence Unit [message #684932 is a reply to message #684456] Thu, 16 June 2011 13:44 Go to previous messageGo to next message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

You can use a SessionCustomizer,

for (ClassDescriptor descriptor : session.getDescriptors().values()) {
descriptor.setCacheSynchronizationType(ClassDescriptor.INVALIDATE_CHANGED_OBJECTS);
}

You should also be able to use a @MappedSuperclass.

Please log an enhancement to have default cache options exposed in the eclipselink orm.xml file or persistence unit properties.


James : Wiki : Book : Blog : Twitter
Re: @Cache annotations set for the entire Peristence Unit [message #684988 is a reply to message #684932] Thu, 16 June 2011 15:03 Go to previous message
J F is currently offline J F
Messages: 242
Registered: July 2009
Senior Member
Thanks. I have submitted https://bugs.eclipse.org/bugs/show_bug.cgi?id=349577.
Previous Topic:EclipseLink JPA: RMI cache coordination problem - cache not sync
Next Topic:Cache coordination instructions for Glassfish 3.1 and JMS
Goto Forum:
  


Current Time: Thu Oct 23 03:15:21 GMT 2014

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

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