I am just starting to work with using TransactionScope, I find that there are always unexpected things I run into that take forever to debug.
I figure that having a consolidated list of these would be great for those "weird error" circumstances, plus to expand our knowledge of oddness in the platform.
Some context on how I am going to...
I have a WCF service that uses ODP.NET to read data from an Oracle database. The service also writes to the database, but indirectly, as all updates and inserts are achieved through an older layer of business logic that I access via COM+, which I wrap in a TransactionScope. The older layer connects to Oracle via ODBC, not ODP.NET.
The p...
Hi everyone,
I'm working on a .Net 2.0 application and need to wrap some database transactions in my code. The backend is SQL Server 2008.
I've been away from .net for a few years, the last time I did any transaction processing was in .Net 1.1 with serviced components. I know about TransactionScope, and was wondering if that's a good...
I have some VB.NET code that creates a TransactionScope instance:
LoggingUtility.LogDebug("UpdateCallTable", "SatComCallDataImporter", "About to associate call data with contracts")
Using ts = New TransactionScope()
LoggingUtility.LogDebug("UpdateCallTable", "SatComCallDataImporter", "Getting all unimported SatCom calls")
My appli...
Hi everyone,
I've been reading about TransactionScope and had a question about its interoperability with ADO.Net transactions. Right now we have some data access methods that each call a stored proc and begin and commit their own individual transactions. Straighforward, boilerplate stuff, the methods look like this:
sqlCommand = //cr...
I have had a good trawl through related questions and implemented suggestions found, but I still have a problem with .NET TransactionScope.
I am calling two WCF services from a method and even though the second service errors (deliberately in this case) the first service doesn't roll back. I have created a simple test application to dem...
Hi,
I am getting Sql deadlocks while calling aspnet_Users_CreateUser Api during load test (100+ concurrent users) I have wrapped the createUser, roles.AddUserToRole and another custom mapping procedure inside a Transaction Scope block. Once the deadlock is encountered no more user accounts are created. I am also using Enterprise Librar...
Hi All,
I need a help. Let me first explain the scenario with a small sample.
Suppose I have a Students table with columns:
Id int(PK)
Name varchar(200)
Marks1 int
Marks2 int
Marks3 int
TotalMarks int
IsTotalCalculated bit
InProcess bit
This table has huge number of records.
Now, I want to calculate the TotalMarks...
If you have somehting like this:
IBinaryAssetStructureRepository rep = new BinaryAssetStructureRepository();
var userDto = new UserDto { id = 3345 };
var dto = new BinaryAssetBranchNodeDto("name", userDto, userDto);
using (var scope1 = new TransactionScope())
{
using(var scope2 = new TransactionScope())
{
//Persist to da...
I have a problem that I know is something local, related to transaction scope, probably MSDTC (I don't know very much about it).
The other project developer (same codebase, everything commited) executes the whole solution, but when I try to get some data from the database (not always), I have the following error:
The underlying provide...
(I know the circumstances surrounding the DTC and promoting a transaction can be a bit mysterious to those of us not in the know, but let me show you how my company is doing things, and if you can tell me why the DTC is getting involved, and if possible, what I can do to avoid it, I'd be grateful.)
I have code running on an ASP.Net webs...
I created a sqlconnection, CN1. Then this CN1 is opened. Later in the code there is a transactionscope. If I execute a sql command on this CN1 connection, is this within transaction?
Code looks like this;
SqlConnection cn1 = new SqlConnection();
cn1.Open(); //connection opened when there is no ambient transaction.
...
using(Transactio...
I need to know the best way to do the following. I have nested business level APIs (say level 1 & level 2). L1 needs to call L2. Both APIs use the database layer directly at their own nesting levels.
Now, in the database layer, I fetch the db connection from the pool each time as follows:
SqlConnection conn = new SqlConnection(conn...
The TransactionScope expects a call to its Complete method as follows. Otherwise the transaction will not be committed.
using(TransactionScope scope = new TransactionScope())
{
/* Perform transactional work here */
scope.Complete();
}
Wouldn't an implementation that assumes success have been more appropriate? This would mean ...
I have not been able to get this working following the docs or other ideas people have tried.
If i use the below, there is no transactional behaviour at all. If i swap the shareddbscope with the transaction scope around, i dont get a save on a single record. if it call ts.complete at the bottom of the transaction i get a single record s...
Hi,
There is a selection sql query(select * from table1 e.g.) by design in a transactionscope in c#. Normally there is an ambient transaction but If I suppress the ambient transaction when executing this sql query, is there a performance gain or not?
using (TransactionScope scope1 = new TransactionScope())
{
// here there are som...
I have a web application that uses the Entity Framework - we make use of the TransactionScope class to provide ambient transactions.
Is there any way to tell EF to use a standard T-SQL transaction in preference to DTC transaction? Quite often we make a number of queries to different tables inside one EntityContext and one TransactionSc...
I have a child TransactionScope within a parent TransactionSope. The child TransactionScope is created, executed, and committed multiple times under the singular parent TransactionScope.
The parent TransactionScope takes care of Insert a single record into the database while waiting for the the second set of insert statements to complet...
We are doing an import process from a source database to a destination database. We need to run these imports frequently in an automated fashion.
The source is on a separate server than the destination. Both are MS SQL 2008. We access the source using Linq2SQL and the destination using a custom Data Layer. We do not ever modify th...
I have a method that uses Entity Framework to do some changes/inserts in different entities, all this inside a single transaction scope. These changes works very well.
My problem has began when I needed to use a stored procedure in the middle of these operations. The procedure does only an insert in one table, and has no explicit declar...