Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Catch 22
Message
 
 
À
10/09/2013 12:29:29
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01581904
Message ID:
01582728
Vues:
30
>>I've discussed this problem with David Browne from MS by email and the problem seems to be in the fact that we're opening the connection prior to instantiating this TransactionScope object and so the existed connections will not enlist in the transactions.
>>
>>I'm going to verify if .NET documentation explicitly states this fact but now what should I do?
>>
>>Thanks.

>
>That makes sense that it would work this way, I guess. You shouldn't leave connections open for any longer than necessary (but you probably already know that), so the question is *why* is your connection already open? And obviously, that part of your code (opening the connection) needs to also be within a TransactionScope.

In our DLL we open connection at the beginning and use it (keep opened). That's the architecture coded. I may ask around for the reasons why did we do it this way (that is coded by the decision makers so I guess it was well thought case). BTW, I tried for that particular case to re-instantiate connection inside the scope but got this error 'Not allowed to change the connection string' ... - I guess I need to add some code to the main class to close the existing connection if I am calling to open a new one.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform