|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: http://wiki.eclipse.org/EclipseLink/Development/200040/FunctionalSpec 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 persistence.xml. 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 > NGED_OBJECTS > ) > > 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: > > http://wiki.eclipse.org/Using_EclipseLink_JPA_Extensions_%28ELUG%29#How_ > 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 > ----- --- http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland http://www.oracle.com/technology/products/ias/toplink/ Oracle TopLink , http://www.eclipse.org/eclipselink/ EclipseLink , https://glassfish.dev.java.net/javaee5/persistence/ TopLink Essentials Wiki: http://en.wikibooks.org/wiki/Java_Persistence Java Persistence , http://wiki.eclipse.org/EclipseLink EclipseLink Forums: http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , http://www.nabble.com/EclipseLink-f26430.html EclipseLink , http://www.nabble.com/java.net---glassfish-persistence-f13455.html Glassfish Persistence -- View this message in context: http://www.nabble.com/Configuring-Cache-for-Objects-in-Persistence.xml-tp14344388p14437543.html Sent from the EclipseLink - Users mailing list archive at Nabble.com.
Back to the top