EHC ❯ Unable to create Multiple CacheManagers without a diskstore
-
Bug
-
Status: New
-
2 Major
-
Resolution:
-
ehcache-core
-
-
drb
-
Reporter: eknight
-
October 07, 2015
-
0
-
Watchers: 1
-
October 08, 2015
-
Description
I’m not sure how to figure out which version of ehcache I’m using exactly so 2.2.0 is just my best guess based on what I’ve been able to google regarding ehcache version.
I’m using Hibernate 3 and it’s whatever comes bundled with that.
The problem that I’ve found is that it’s not possible to create multiple cache managers that do not use the diskstore.
CacheManger.java line 251 there is the following code:
diskStorePath = configurationHelper.getDiskStorePath();
In the description of getDiskStorePath() it says:
// the disk store path, or null if not set.
a few lines later there is the following code which is only executed when there already exists at least one other cache manager :
diskStorePath.equals(cacheManager.diskStorePath)
If the current cache manager doesn’t have a diskstore then this results in a null pointer exception.
Is this something that’s been fixed in later version or is there a possible workaround that doesn’t involve using diskstore?
Everything works fine if I add this:
to the ehcache.xml. However I can’t use a diskStore at all and in the description of the ehcache.xml it says:
The diskStore element is optional. To turn off disk store path creation, comment out the diskStore element below.
Which doesn’t seem entirely true at the moment.