Multiple Grails Applications Create Ehcache Conflicts

I am running several Grails applications on one of my servers. I am using Grails 1.2.2. I am using the default cache configuration in DataSource.groovy. When I try to run two Grails applications, they both seem to use / write:

/tmp/org.hibernate.cache.UpdateTimestampsCache.data p>

When I look at how to configure Ehcache with the ehcache.xml file from this page:

http://ehcache.org/documentation/grails.html

I do not see any information about the location and / or names or temporary files.

How to avoid this problem when running multiple Grails applications on the same server (without disabling the cache)?

Clarification: regarding Deepak's answer

Since I am deploying it as a war, will this be an example of what I would add to the Config.groovy environment block?

environments {
    production {
        java.io.tmpdir = /tmp/myapp-prod.tmp
    }
}
+3
source share
2 answers

I have encountered this problem before. I just specified a different location for the java.io.tmpdir system property when starting the embedded Grails server. For instance.

Grails -Djava.io.tmpdir = / home / dmittal / tmp run-app

You need to specify a different temp directory location for different grails applications.

+5
source

Add the following to the ehcache.xml file (mine is in the root directory of the project) to configure the path to the ehCache repository:

<diskStore path="java.io.tmpdir"/>
0
source

Source: https://habr.com/ru/post/1745208/


All Articles