Are there any special configuration for two Grails application using same database and tables? -
I have two grails (1.2.1) applications deployed in two different app servers. An app contains the main site (view, controller, domain, etc.) and the second app has a quartz plugin that corrects and backend processing. Both apps are sharing domain classes and similar datasource configurations, that means two apps are accessing the same databases and tables.
My question is: Is there any penalties for inquiring the database?
The quartz job app is running, so I'm just looking at the slow end of the main site app. No obvious evidence or statistics though. Can the hibernate component control the vascular and transactions in every event on every app? Or do I need to configure something in grails-app / conf on every app? Right now, I did not add additional configuration.
Thank you.
I can think that the main problem will be problem with level caching. If both apps try and use cache data, it can cause StaleObjectExceptions and so on when the cache gets out of sync with DB, because it is being replaced by another app. Caching on the other hand is disabled by default, although you do not have any problems there.
It also depends on whether or not you use optimistic locking provided by default or clear locks with the lock () method on your domain. Optimistic locking should not be slow (but exceptions may be caused if saved if second app has updated the row).
Comments
Post a Comment