transactionscope


TransactionScope and Connection Pooling

折月煮酒 提交于 2020-01-22 18:40:51
问题 I'm trying to get a handle on whether we have a problem in our application with database connections using incorrect IsolationLevels. Our application is a .Net 3.5 database app using SQL Server 2005. I've discovered that the IsolationLevel of connections are not reset when they are returned to the connection pool (see here) and was also really surprised to read in this blog post that each new TransactionScope created gets its own connection pool assigned to it. Our database updates (via our

TransactionScope and Connection Pooling

僤鯓⒐⒋嵵緔 提交于 2020-01-22 18:40:46
问题 I'm trying to get a handle on whether we have a problem in our application with database connections using incorrect IsolationLevels. Our application is a .Net 3.5 database app using SQL Server 2005. I've discovered that the IsolationLevel of connections are not reset when they are returned to the connection pool (see here) and was also really surprised to read in this blog post that each new TransactionScope created gets its own connection pool assigned to it. Our database updates (via our

Recommended practice for stopping transactions escalating to distributed when using transactionscope

删除回忆录丶 提交于 2020-01-22 13:55:49
问题 Using the TransactionScope object to set up an implicit transaction that doesn't need to be passed across function calls is great! However, if a connection is opened whilst another is already open, the transaction coordinator silently escalates the transaction to be distributed (needing MSDTC service to be running and taking up much more resources and time). So, this is fine: using (var ts = new TransactionScope()) { using (var c = DatabaseManager.GetOpenConnection()) { // Do Work } using

Difference Between Transaction and TransactionScope

我的梦境 提交于 2020-01-22 07:16:08
问题 I am developing an application which communicates with an SQL Server 2005 database to execute some stored procedures. My client demands that all transactions be managed on the C# side and not by SQL Server, and so I am using System.Transactions.TransactionScope when accessing the database. However, I have just seen the System.Transactions.Transaction datatype, and I am confused... What are the main pros/cons of each type? Which one should I use? Please note that I must also use Enterprise

Difference Between Transaction and TransactionScope

有些话、适合烂在心里 提交于 2020-01-22 07:15:26
问题 I am developing an application which communicates with an SQL Server 2005 database to execute some stored procedures. My client demands that all transactions be managed on the C# side and not by SQL Server, and so I am using System.Transactions.TransactionScope when accessing the database. However, I have just seen the System.Transactions.Transaction datatype, and I am confused... What are the main pros/cons of each type? Which one should I use? Please note that I must also use Enterprise

Dapper & TransactionScope?

…衆ロ難τιáo~ 提交于 2020-01-20 13:21:46
问题 I just started playing around with Dapper. So far i love it. Does dapper not work with TransactionScope ? I noticed that even if i never call TransactionScope.Complete then my changes are still committed to the database. If TransactionScope isn't supported now is there any plans in the future to support it? If not then you have to use traditional transaction management (System.Transactions.Transaction)? Update: I just talked to Sam over Twitter. It should work. I'll update it tomorrow morning

Dapper & TransactionScope?

不问归期 提交于 2020-01-20 13:21:36
问题 I just started playing around with Dapper. So far i love it. Does dapper not work with TransactionScope ? I noticed that even if i never call TransactionScope.Complete then my changes are still committed to the database. If TransactionScope isn't supported now is there any plans in the future to support it? If not then you have to use traditional transaction management (System.Transactions.Transaction)? Update: I just talked to Sam over Twitter. It should work. I'll update it tomorrow morning

Intermittent System.ArgumentNullException using TransactionScope

女生的网名这么多〃 提交于 2020-01-14 14:17:07
问题 I have a Windows Service application which is performing some calls to SQL Server. I have a particular unit of work to do which involves saving one row to the Message table and updating multiple rows in the Buffer table. I have wrapped these two SQL statements into a TransactionScope to ensure that they either both get committed, or neither get committed. The high level code looks like this: public static void Save(Message message) { using (var transactionScope = new TransactionScope()) {

C# Azure Storage Blob Upload TransactionScope

不问归期 提交于 2020-01-14 09:35:47
问题 Is there somewhere a class to allow roll back with transactionscope on azure blockblob actions ? I would like make this works: CloudBlockBlob blockBlob; private void UploadPicture(Stream iStream) { using(var ts = new TransactionScope()) { blockBlob.UploadFromStream(iStream); throw new Exception(); ts.Complete(); } } When the exception is raise, the uploaded file is not cancelled. If is not possible with transaction scope, how should I proceed ? 回答1: Azure Storage Client Library does not

Hierarchy of TransactionScope

旧城冷巷雨未停 提交于 2020-01-13 16:44:12
问题 Is it possible to have a hierarchy of transaction scopes? If the outer transaction scope does a dispose, what will happen to changes made in the inner transaction scope? My particular problem is that I have test code that runs code that has a transaction scope. When I call a second set of code with a transaction scope I get "Cannot access a disposed object. Transaction". Could it be that the dispose of the inner transaction scope is also disposing the outer transaction scope. 回答1: I doubt

工具导航Map