views:

107

answers:

1

I have two applications each pointing to a different database. when I deploy these applications to Tomcat at the same time, whichever datasource gets loaded first is the same datasource that gets used for both apps. I am using the latest Tomcat and Grails.

A: 

Configure datasources in Tomcat h..p://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html

Access them via JNDI h..p://www.grails.org/JNDI+Data+Sources

ilya b.
Isn't there something better? I mean, why it is this way by default? What use does it have to share DataSources.groovy and how does it even do that since the wars are supposed to be isolated? Am I missing something here?
John Wheeler
I don't know exactly why Groovy behaves in such weird way (I have never deployed 2 applications to the same appserver), but using JNDI has always been reliable measure to treat application's datasource problems
ilya b.