-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Feature Req.: More flexibility initalizing/extending cache
PostPosted: Thu Jan 19, 2006 12:25 pm 
Newbie

Joined: Thu Jan 19, 2006 10:36 am
Posts: 1
Hello,
For EHCache the default disk cache file location is something like this:
/tmp/org.my.package.SomeClassFile.data.

This doesn't work in an Enterprise environment. One example of this is what do you do if you have multiple instances of the same app running on the same server?

There are two ways to solve this:
- modify the java.tmp.dir, user.home, or the user.dir system properties
- write your own CacheProvider class that initializes the EhCache with whatever values you want.
- modify the /ehcache.xml file

Unfortunately the environment I work in has a tight security policy that prevents the changing of System.properties once they are set. Also, since I need to be able to run multiple instances of the same app on the same machine I need to create unique cache directories at run time. That leaves the unfortunate choice of having to create my own CacheProvider.

I would like to suggest a few fixes to make this easier:
- in org.hibernate.cache.EhCacheProvider, make non-static variables (like 'manager') protected. This simple change means instead of having to copy the entire file I extend it and just overload the start(...) method.
- It would be nice if I could set the ehcache.xml file from within my hibernate file. One way to do this would be to have a generic element that can contain the config file for any cache provider. For example, ehcahce might look like:
/hibernate-configuration/cache-configuration/ehcache/....
I think this would be a nice way to expose the configuration options of any cache provider but in a simple and generic way. It would be up to the hibernate cacheProvider to read in that information and pass it to the underlying cache implementation.

Let me know if you would like me to send you some code.

Regards,
Adam Greene


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.