Skip to main content



      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 11:46 Go to next message
Eclipse UserFriend
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 09:44 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: @Cache annotations set for the entire Peristence Unit [message #684988 is a reply to message #684932] Thu, 16 June 2011 11:03 Go to previous message
Eclipse UserFriend
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: Fri Jul 04 18:05:48 EDT 2025

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

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

Back to the top