Closed GoogleCodeExporter closed 9 years ago
Sorry damn, wasn't meant to record this as a defect! Apologises
Original comment by matt8...@gmail.com
on 11 Sep 2008 at 5:38
Here is a modified version of S#arp that has support for multiple session
factories.
It's not the most elegant code or solution, but I was in a bit of a pinch and
seems
to work fine. This branch is no longer associated with the svn repos, so I
couldn't
just send a patch (instead i sent the entire solution). For that matter, it's
actually based on the previous version of Sharp; so I'm only providing this for
the
rest of the group and Billy to get some ideas.
Essentially, I have extended the NHibernateSession with a couple of
Dictionaries for
storing multiple SessionFactories and SessionStores. I also included a class
attribute called SessionFactoryAttribute that is used to decorate your DAOs
with the
appropriate datastore key (In my case this is Oracle and SQLServer). The
GenericDao
was then updated to read this attribute. If it is not found, it defaults to the
original NHibernate.Session.Current singleton.
Your nhib config needs to change a bit too. You need to use an external config
file
for each db. In the config you must specifically list the hbms that are mapped
to
that particular config as opposed to mapping an entire assembly.
I hope this helps anyone out there that needs multiple DB support before it
makes it
into the architecture officially.
Original comment by russell....@gmail.com
on 10 Oct 2008 at 6:38
Attachments:
IS there any progress in this aspect?
Accessing multiple databases is very important (and common) in real projects..
Original comment by manuelfe...@gmail.com
on 4 Mar 2009 at 6:29
This will be in the 1.0 final release, but will not make it into the RC 2
release,
due for this weekend. (Another reference I found concerning this was at
http://tiredblogger.wordpress.com/2009/03/06/using-multiple-nhibernate-session-
factories/ )
Original comment by wmccaffe...@gmail.com
on 12 Mar 2009 at 7:29
Hi,
I'm currently evaluating Sharp Archicture (it's awesome btw) but have also hit
the
single db connection wall very quickly - is there any update on when this
feature is
going to be available (in the main trunk or as a patch to the RC2)?
Many thanks,
Howard
Original comment by howard.v...@gmail.com
on 1 Apr 2009 at 8:57
Hi Howard, current priorities are as follows:
* Add WCF support and example of using it; the WCF support is ready but not
committed
- finishing up the example.
* Add example of using a service.
* Provide support for multiple DBs.
I should be able to get to multiple DB support by mid April or sooner.
Original comment by wmccaffe...@gmail.com
on 2 Apr 2009 at 4:45
Original comment by wmccaffe...@gmail.com
on 8 Apr 2009 at 10:35
Fixed on trunk...see /docs for details within the Q&A section. Also see
/VersionHistory.txt for a detailed listing of related changes.
Original comment by wmccaffe...@gmail.com
on 2 May 2009 at 7:35
What makes WCF not support multiple databases in the current release, btw?
Original comment by alen.siljak
on 25 Nov 2010 at 1:01
Original issue reported on code.google.com by
matt8...@gmail.com
on 11 Sep 2008 at 5:38