Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple Grails Applications create Ehcache conflicts

I am running multiple 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 and run two Grails applications, they both seem to be using/writing to:

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

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

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

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

How do I avoid this issue when running multiple Grails applications on the same server (without turning off the cache)?

Clarification: In reference to Deepak's answer

Since I am deploying this as a war, would this be an example of something I would add to the environments block of Config.groovy?

environments {
    production {
        java.io.tmpdir = /tmp/myapp-prod.tmp
    }
}
like image 258
Lloyd Meinholz Avatar asked Mar 08 '26 10:03

Lloyd Meinholz


1 Answers

I have faced this problem before. I simply specified a different location for the java.io.tmpdir system property while starting grails embedded server. For example.

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

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

like image 128
Deepak Mittal Avatar answered Mar 11 '26 02:03

Deepak Mittal