transactionscope

Advanced System.Transactions debugging

孤人 提交于 2020-02-02 09:28:06
问题 Are there any tips, tricks or methods for obtaining profiling/logging/debug information on the runtime behaviour of System.Transactions.TransactionScope ? I have an application which is committing data to the database, even though I'm using System.Transactions.TransactionScope , where an exception is thrown and TransactionScope.Commit() is never called. I was wondering if there are events or details on other classes used by TransactionScope that I can query at runtime to establish whether my

asp.Net TransactionScope error

▼魔方 西西 提交于 2020-01-30 09:09:30
问题 Here is my coding using (TransactionScope scope = new TransactionScope()) { using (DataAccess.Document Access = new DataAccess.Document()) { if (toSave.Document.Rows.Count > 0) { Access.SaveDocument(docToSave); } if (toUpdate.Document.Rows.Count > 0) { Access.UpdateEachDocument(docToUpdate); } } scope.Complete(); } here is the error ExecuteNonQuery requires an open and available Connection. The connection's current state is closed. Document is a class and there are save and update document

Why is TransactionScope using a distributed transaction when I am only using LinqToSql and Ado.Net

廉价感情. 提交于 2020-01-30 06:02:08
问题 We are having problems on one machine, with the error message: "MSDTC on server XXX is unavailable." The code is using a TransactionScope to wrap some LingToSql database code; there is also some raw Ado.net inside of the transaction. As only a single sql database (2005) is being accessed, why is a distributed transaction being used at all? (I don’t wish to know how to enable MSDTC, as the code needs to work on the server with their current setup) 回答1: This almost always happens when your

Why is TransactionScope using a distributed transaction when I am only using LinqToSql and Ado.Net

限于喜欢 提交于 2020-01-30 06:01:39
问题 We are having problems on one machine, with the error message: "MSDTC on server XXX is unavailable." The code is using a TransactionScope to wrap some LingToSql database code; there is also some raw Ado.net inside of the transaction. As only a single sql database (2005) is being accessed, why is a distributed transaction being used at all? (I don’t wish to know how to enable MSDTC, as the code needs to work on the server with their current setup) 回答1: This almost always happens when your

nhibernate and transactionscope transaction aborted spontaniously

落爺英雄遲暮 提交于 2020-01-23 20:28:25
问题 I am working with Nhibernate and TransactionScope in a large application. The application is supposed to modify 3 databases and support a distribuited transaction across them. This is the code that I call each time I want to query or execute some sql on the database within the distribuited transaction: IDbConnection connection = new SqlConnection(connectionString); connection.Open(); ISession session = SessionFactory.OpenSession(connection); And this is the code called whenever after the

TransactionScope deadlocked issue in concurrency

杀马特。学长 韩版系。学妹 提交于 2020-01-23 16:57:10
问题 I have two different databases on two different servers, and I have used a TransactionScope . I'm using TransactionScope for the first time. But in concurrency while updating Table1 I'm getting an error Transaction (Process ID 64) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. Checked TransactionScope related articles on net option.IsolationLevel = System.Transactions.IsolationLevel.ReadUncommitted; option.Timeout =

SQLTransaction has completed error

天大地大妈咪最大 提交于 2020-01-23 04:50:36
问题 I got following error once in my application. This SQLTransaction has completed; it is no longer usable Stack Trace is attached below – It says about Zombie Check and Rollback . What is the mistake in the code? Note: This error came only once. UPDATE From MSDN - SqlTransaction.Rollback Method A Rollback generates an InvalidOperationException if the connection is terminated or if the transaction has already been rolled back on the server. From Zombie check on Transaction - Error One of the

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