Reputation: 2284
I found a couple of articles how to use NHibernate with multiple database, for example this one http://codebetter.com/karlseguin/2009/03/30/using-nhibernate-with-multiple-databases/
But all articles are very old, and may be there is some new approach with NH 3.x? I looked in documentation but did not found anything, but maybe i missed somthing?
Does anybody knows some better way (native NH3.x way) to use NH 3.x with multiple database than described in this article? http://codebetter.com/karlseguin/2009/03/30/using-nhibernate-with-multiple-databases/
Thanks, Alexander.
Upvotes: 1
Views: 1484
Reputation: 64628
AFAIK, there is nothing new in NH 3. But there are still more options to use several databases than in the blog post you linked.
use database
statement on sql server).Upvotes: 3
Reputation: 30803
The articles you linked are still the way to go. Each SessionFactory is responsible for a single connection (connectionstring) and schema.
There is one special case where ou split the database into multiple with the same schema to load balance. This is called sharding and there is the contrib NHibernate.Shards to deal with it.
Upvotes: 0