-->
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: Modifying Connection Strings at Run-Time
PostPosted: Mon Aug 18, 2008 10:30 am 
Newbie

Joined: Mon Aug 18, 2008 10:17 am
Posts: 4
I'm working on an existing system that has generated code that is no longer wanted. It's a matter of migrating from the generated code that uses ADO.NET to NHibernate.

The generated code allows the developer to select a connection string by name at run-time depending on the system that makes the call to the Data Access Layer.

I want some recommendations on methods of implementing the same choice for our developers with NHibernate easily. Currently I can see some information on pointing NHibernate to use an App.Config connection string, but if I want to give the developers a choice from the available connection strings within the App.Config how would I go about doing this?

Any help is generally appreciated.

Hibernate version: 2.0.0


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 20, 2008 5:22 am 
Newbie

Joined: Wed Aug 20, 2008 4:49 am
Posts: 3
Location: London, UK
1/ If it's different schemas, the mapping file supports a schema attribute on the hibernate-mapping bit.

2/ If it's different databases, I'd use Spring.Net and the MultiDelegatingDbProvider for that functionality. You will need a session factory for each database.

3/ If it's different configurations, manage this with system.configuration (write your own config section handler for it).


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 20, 2008 5:26 am 
Newbie

Joined: Mon Aug 18, 2008 10:17 am
Posts: 4
I'm using Spring with Java so it makes sense to try and replicate what works well into the .NET projects.

All three suggestions make sense. Appreciated.


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.