Multiple database for asp.net application

Multiple database for asp.net application

Old forum URL: forums.lhotka.net/forums/t/10227.aspx


gbarje posted on Friday, April 01, 2011

Hi

Application we are trying to develop has multiple DB say 2 Databases. I am using CSLA frame work with single adohelper class in DAL and generating the BLL using CSLA templates. I am using dot net 4.0 framework.

 

My question is currently we are using WCF to connect to the other datbase and one db string is stored in my web.config of the application. In this such situation should I go for the 2 connection strings. My 2 databases reside on 2 different locations/servers.

 

RockfordLhotka replied on Friday, April 01, 2011

Yes, if you have two databases you will need two connection strings.

Your data access code (in any of the four data access models) will then open connections to both databases as necessary to get and update the data in your object model.

If you need transactional protection, you must use EnterpriseServices transactions, and that will use the DTC. If you have two databases, you must use distributed 2-phase transactions. That results in lower performance, and means you must configure the DTC, but you get transactional safety at the database level.

Copyright (c) Marimer LLC