I'm creating a project where there will be a main database (where are some global things) and files (which are basically sqlite files).
Obviusly when the user clicks "open" and selects a new file, I would like that the application will load this new database.
Actually I managed to work with 2 configuration files http://www.darkside.co.za/archive/2008/01/21/castle-activerecord-connecting-to-multiple-databases.aspx
However, there are 2 problems: first, password is clear in xml file, while this could be ok for global things, it's not very good for files created by the user (I still don't know if this is a real problem, I have to ask if they want passwords for their files).
the otherone is that connection strings will be different for each file (yes I have to change the path!), so I can work in 2 ways:
- Create a local copy of the db and when the user press "save", the database will be copied over the older one
- Find a way to change the connection string or load a configuration "on runtime"
I'm looking forward DifferentDatabaseScope, but I don't understand: where i specify all NHibernate configuration if I use this? (I have to pass only a connection object!!!)
There isn't a direct way to change database in use except at castle activerecord start, that's what I found.