tags:

views:

48

answers:

3

Hi,

Can Nhibernate work with 2 different schema? I have a project to work with say schema A fro few parts and Schema B for others. is this possible with Nhibernate. How can i do that?

Thanks

Arvind

A: 

It is possible, but not that straightforward. See this article. Googling will also help.

kgiannakakis
Googling is not an answer. Googling for NHibernate and Schema brings up a myriad of useless information. This is something he's probably already done and thus, his question.
Brian
Actually the user accepted an answer that directed him to the same article I suggested. The article appears first in Google when you search for 'Nhibernate multiple database'.
kgiannakakis
A: 

I think it is possible, but you'll have to instantiate 2 session factories.

Perhaps this article can be helpfull

Frederik Gheysels
+3  A: 

If these schemata are in the same database, you can specify it in the mapping file:

<class name="MyClass" schema="A">
...
</class>

<class name="AnotherClass" schema="B">
...
</class>
Stefan Steinegger