Hello,
I have worked in hibernate for one database only. I am working on a project, where the database name will be taken as input from user. The user will then be allowed to work with that database.
Though the database name will be taken as input, all database will be having same schema architecture...So one cfg.xml will help...
I learnt from various sites, how to create dynamic configuration at runtime... Changing the dbsource property of the configuration... and then creating the session factory...
I will take the database name from user, create the configuration and then build a session factory...
One thing that is bothering me....changing the hibernate configuration will impact all the users logged in. While my requirement is user - database one to one mapping...
Please advise on this...how i should take this? Even if i create different session factories, should i keep user specific session factory in UserContext?
|