|
|
Connecting to a database dynamically
Hi
I have a use case where the user will select a region, and based on the selected region, I need to connect to that database and display the data.
We have around 30 databases that could be selected by the user. The schema of all the database is same, only the data varies based on the region. The business user will have to explore the data of each region on a regular basis.
The plug-ins' that I am thinking are:
1) Datasources
2) Multi tenant.
1) Datasources: The problem with this plug-in is that it will pre-load all the connections. I mean to say, I get the connection whether I want or not when the application is initialized. I can set the initial size to zero. Still I get connected to the database.
2) Multi tenant: I do not have much exposure to this. But from documentation it is doing the same but in a different way. I can call and hook up a particular datasource to 1 to1 or 1 to N.
I am interested to know if there are other plug-ins or some one has already worked out for the same case?Thanks and appreciate help.
I don't know of any other plugins that do this kind of thing, sorry. I would ask on the Grails Plugins forum whether the DataSources plugin can be configured to do what you want:
plugins/forum
Post to quot;All other pluginsquot;.
That forum is designed to handle questions about specific plugins rather than core Grails features.
Peter
Thanks Peter.
I will go to the suggested forum and look around. |
|