1,062 questions
-1
votes
1
answer
198
views
link server SQL transaction scope not working
I am not able to use the connection within the transactionscope It is displaying the error
MSDTC on "server" is unavailable.
1
vote
1
answer
513
views
TransactionScope in business layer for dirty async read
I'm developing a .NET Core web api service and have the following method in BL:
public async Task<SetParams> GetParams(CreateRequest request)
{
var user = await ...
5
votes
2
answers
4k
views
What happens to Transaction if TransactionScope.Complete not called at the end of the Using block
I am using the SQL Server 2012 and There are multiple SQL Connections to same database inside the TransactionScope Using block. But if first Update SQL Operation does not result desired output then I ...
1
vote
1
answer
252
views
Remove TransactionScopeRequired = true
I have an operation contract, on a windows service and it has an attribute
[OperationBehavior(TransactionScopeRequired = true)]
I would like to get rid of this attribute. Reason :
containerize the ...
0
votes
1
answer
2k
views
Entity Framework Rollback using Transaction Scope
I am trying to create a method that links multiple updates to database using Entity Framework and Transaction Scope. I want to be able to do a Rollback in case of validation error/exception. My setup ...
4
votes
2
answers
4k
views
Do I need to close the DbConnection manually when using ambient transactions with EF Core 2.1?
EF Core 2.1 introduced support for ambient transactions. The sample creates a new SqlConnection, manually opens it and passes it to the DbContext:
using (var scope = new TransactionScope(
...
1
vote
1
answer
372
views
DbContext.SaveChanges() visibility within a TransactionScope
Given a TransactionScope with 2 subsequently opened DbContexts, are changes saved by the first context guaranteed to be visible within the scope of second context?
var txOptions = new ...
1
vote
0
answers
2k
views
Using Transactions and TransactionScopes with Entity Framework Core 2.1 and dbcontext
I'm trying to create dependent transactions in Entity Framework Core (v. 2.1).
The idea is to create "children" transactions inside a "father" transaction.
If one of the childs fails, so will have ...
2
votes
2
answers
457
views
Create TransactionScope and Create Context order
What is difference of these codes:
using (TransactionScope tran = new TransactionScope ())
{
using (Entities ent = new Entities())
{
and
using (Entities ent = new Entities())
{
using (...
0
votes
0
answers
514
views
Failed TransactionScope still completing
For a long time I've been using the following structure when using TransactionScope.
using(var con = new SqlConnection(CONNECTIONSTRING))
{
con.Open();
foreach(var file in files)
{
...
1
vote
2
answers
618
views
Transactionscope.Required not workings for first item in list
I am using SQLServer with C#.
foreach(var item in list)
{
TransactionOptions transOption = new TransactionOptions();
transOption.IsolationLevel =
System.Transactions.IsolationLevel....
0
votes
1
answer
670
views
C#, SQL SP inside transactionScope ends transaction by timing out
With the code:
using (TransactionScope scope = new TransactionScope( TransactionScopeOption.RequiresNew, new System.TimeSpan( 0, 15, 0 ) ))
{
try
{
for (int i=0; i<10000; ...
2
votes
2
answers
1k
views
Triggering a rollback inside transactionscope C#
I'm currently working on a stored procedure that will perform a couple of inserts into a database table and I want to test and see if it can return the total rows affected in a way I'd like it to. And ...
3
votes
2
answers
7k
views
Transaction Scope With API calls
I am working on a process that is distributed and dependent on some internal db operations as well as some third-party APIs. I want to leverage the transaction scope capabilities to roll back if at ...
4
votes
2
answers
3k
views
Best way to fire and forget async code inside TransactionScope
I'm doing some stuff inside a using block for a TransactionScope object. At some point I wanted to call some async code by firing and forget (I don't want to wait for the result, and I'm not ...
2
votes
0
answers
335
views
Transaction not working with aspnetusers table in .net core 2.0
I want to implement transaction with Asp.net core Identity tables.
After get execute _userManager.CreateAsync method data get saved in AspnetUser table but in other table data does not save without ...
1
vote
1
answer
2k
views
Get the transaction id when the transaction is committed
I am using IEnlistmentNotification interface from transaction scope and I want to access the current transaction id in the commit method after the scope is completed like this:
public void Commit(...
1
vote
0
answers
95
views
Refresh/Access updated Entities outside the transaction in Spring
I am spawning a newSpring transaction inside a readonly Spring transaction. The new transaction is creating an entry in DB. After coming out of the new transaction I am not able to fetch the data in ...
3
votes
2
answers
4k
views
SQL Server ROLLBACK transaction took forever. Why?
We have a huge DML script, that opens up a transaction and performs a lot of changes and only then it commits.
So recently, I had triggered this scripts (through an app), and as it was taking quite ...
1
vote
0
answers
486
views
TransactionScope issues with OnAuthorizationAsync with our own AuthorizeAttribute implementation
We've been expanding the use of TransactionScope in our ASP.NET Web Application with an AzureSQL DB. Everything seems to work fine locally and on our development server. Even on our production server ...
1
vote
0
answers
434
views
SQL Server trigger with EF TransactionScope
Can anyone help me with problem with trigger on insert/update when inserting records to tables in a SQL Server database using EF and TransactionScope?
When I try the trigger in SQL Server Management ...
1
vote
1
answer
846
views
ASP.NET MVC - How to use code first and database first method in same project and with same context
I have a requirement that I have to use code first pattern (which I have to implement) along with database first (which exists in the current system).
Now the condition is I must not create a ...
4
votes
1
answer
6k
views
Entity Framework :Using Transaction Scope how to check whether DbContext has transaction?
As mentioned here
using Entity Framework 6 if we begin a transaction using Database.BeginTransaction()
we can check whether a context has a transaction using this statement:
var transaction = db....
2
votes
0
answers
655
views
SqlConnection doesn't automatically enlist to TransactionScope
I read the following StackOverflow posts about nested transactionScope, but I couldn't get it to work in one of my integration tests. I wanted to insert some records into the database and verify the ...
2
votes
1
answer
305
views
Why does the SQL Server Isolation level revert to default within the same session using EF TransactionScope
I am having an issue with using Entity Framework TransactionScopes.
Upon reading the documentations and viewing multiple examples and suggestions, I have implemented Transaction Scopes on many ...