-->
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: Automatic instantiation of EhCache CacheManager?
PostPosted: Mon Oct 24, 2005 10:17 am 
Newbie

Joined: Mon Oct 24, 2005 9:53 am
Posts: 1
Location: Munich / Germany
Hi,

I was experiencing a weird problem using hibernate3 in an application based on the Spring-Framework, which I would regard at least as a design flaw of hibernate:

I was trying to use ehCache within my application and provided a configuration-file via Spring framework's EhCacheManagerFactoryBean. This worked well unless I started using hibernate, afterwards my EhCache-Configuration seemed to be ignored.
It seems that hibernate instantiates the CacheManager of ehCache without being told to do so (I never explicitly configured caching for hibernate) just when the library is available. Since the ehCache CacheManager is designed as a singleton, it happens that hibernate comes first and instantiates the CacheManager with its default configuration. The later instantiation of ehCache by the EhCacheManagerFactoryBean of the Spring Framework just returns the instance with the default configuration.

I simply solved the problem by making sure that the EhCacheManagerFactoryBean is instantiated before hibernate's SessionFactory.

I was just wondering if anybody experienced similar problems or knows if the assumption that ehCache is instantiated by hibernate just upon availability of the library is correct. In that case I would call it a bug...

Regards,

Christoph


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.