Comments (9)
Sorry damn, wasn't meant to record this as a defect! Apologises
Original comment by [email protected]
on 11 Sep 2008 at 5:38
from sharp-architecture.
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 [email protected]
on 10 Oct 2008 at 6:38
Attachments:
- [SharpArchitecture - Multiple DB.zip](https://storage.googleapis.com/google-code-attachments/sharp-architecture/issue-12/comment-2/SharpArchitecture - Multiple DB.zip)
from sharp-architecture.
IS there any progress in this aspect?
Accessing multiple databases is very important (and common) in real projects..
Original comment by [email protected]
on 4 Mar 2009 at 6:29
from sharp-architecture.
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 [email protected]
on 12 Mar 2009 at 7:29
- Changed state: Accepted
from sharp-architecture.
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 [email protected]
on 1 Apr 2009 at 8:57
from sharp-architecture.
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 [email protected]
on 2 Apr 2009 at 4:45
from sharp-architecture.
Original comment by [email protected]
on 8 Apr 2009 at 10:35
- Changed state: Started
from sharp-architecture.
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 [email protected]
on 2 May 2009 at 7:35
- Changed state: Fixed
from sharp-architecture.
What makes WCF not support multiple databases in the current release, btw?
Original comment by alen.siljak
on 25 Nov 2010 at 1:01
from sharp-architecture.
Related Issues (20)
- ClickToBuild.bat fails to build HOT 5
- Has this project been forgotten about? HOT 2
- Model Binder fails with Collections with IDs defined as GUIDs HOT 2
- Northwind sample fails to build HOT 8
- Tests don't pass when creating an entity HOT 2
- VS Project Template (1.0.493) contains 1.0.0.0 version of binaries HOT 1
- AutoMappingOverride class doesn't feel affects of WithTable command HOT 6
- EntityDuplicateChecker should fully support EntityWithTypedId<IdT> HOT 2
- SharpModelBinder has a chance to swallow exceptions HOT 1
- S#arp Architecture model binder enumeration error HOT 6
- The Architecture is so large! HOT 1
- DbContext.BeginTransaction to return ITransaction to allow using BeginTransaction in using statement HOT 2
- SessionFactoryAttribute is not beeing used while having single database initialized with non-default key, HOT 3
- Moving to the FluentNHibernate 1.0 and NHibernate 2.1.0.4000
- BuildUrlFromExpressionForAreas<>()
- Downloads on www.sharparchitecture.net after revision 493 are corrupt HOT 2
- Problem running Northwind sample, Exception "The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)." HOT 1
- NHibernateSession.Init() is not exception safe
- Download page on sharparchitecture.net still points to google code
- Issues with RenderCore (not replaced with TransformText) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sharp-architecture.