These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: how do I use NHibernate to map multiple databases?
PostPosted: Tue Oct 03, 2006 6:22 am 
Regular
Regular

Joined: Thu Aug 24, 2006 2:05 am
Posts: 80
how do I use NHibernate to map multiple databases?
As per the NHibernate documentation, it does provide support for multiple databases but nowhere I found the sample code for the same.
If anyone has the sample code snippet then plse do provide me or else gimme a pointer.

-Thanks
Deepak


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 03, 2006 3:14 pm 
Beginner
Beginner

Joined: Sat Sep 09, 2006 5:55 am
Posts: 23
You would need a SessionFactory per database.

I think you'd have to create a Configuration object for each database first.
You can call cfg.Configure(string configfilename) on the the Configuration objects to initialize them with the desired config params.
Alternatively you can use an IDictionary with parameters to initialize the configuration through the AddProperties(IDictionary) method.

After all this you can call BuildSessionFactory() on those configurations to create the SessionFactory instances.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 04, 2006 3:57 am 
Regular
Regular

Joined: Thu Aug 24, 2006 2:05 am
Posts: 80
Found out the article to configure multiple databases in Web/Windows/Console Application. Link for the same is given below:
http://www.codeproject.com/useritems/NH ... pleDBs.asp

-Regards

Deepak


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.