We currently have a single Db that all clients share, but we have been asked to allow for a client to isolate themselves by moving the data to another Db. These new Dbs will have the same schema. We currently create 1 Session Factory and would like to keep it this way. When I call factory.OpenSession() does it return a new connection that I can manipulate without effecting other Sessions?
Code:
public ISession CreateSession(string databaseName)
{
ISession session = _factory.OpenSession();
session.Connection.ChangeDatabase(databaseName);
session.FlushMode = FlushMode.Commit;
return session;
}
Is the above the best way to handle this or is there another prefered method?