Skip to main content
Filter by
Sorted by
Tagged with
Best practices
2 votes
2 replies
65 views

I am pondering whether the using TransactionScope should be within a try..catch or the other way around. Within try..catch try { using (var scope = new TransactionScope()) { ...
AngryHacker's user avatar
  • 62.1k
2 votes
1 answer
97 views

For a project I'm working on, I'd like to insert testdata before every test and then rollback the transaction for the next test to start with a clean slate. The skeleton code below works fine for that:...
Caramiriel's user avatar
  • 7,375
0 votes
0 answers
69 views

I am trying to use TransactionScope to make my db context operations spread across different files run under one transaction, so all or none save should happen. The problem is it is giving me this ...
Pawan Nogariya's user avatar
0 votes
1 answer
68 views

I have a Azure function, which calls some API endpoint for database update/insert and then will complete the message in the Queue.In case azure functions code fails after API success, I want to ...
Indian songs comedy jolly  use's user avatar
-1 votes
2 answers
237 views

I wrote an integration test to insert two documents with two threads simultaneously, after the test is completed, I expect none of the records inserted during the test exist in the database. I used ...
Masoud's user avatar
  • 8,246
3 votes
1 answer
304 views

Short version We want to disable the automatic enlistment to ambient transactions (System.Transactions.TransactionScope) for a whole Entity Framework Core 8 DbContext. The DbContext should never get ...
M.E.'s user avatar
  • 2,929
1 vote
0 answers
89 views

In ASP.NET Core 6.0, I am trying to update an Azure SQL database, and as well call a REST API for an external service, and if the external service call fails, I want to rollback the update. My code is ...
Ghassan Karwchan's user avatar
0 votes
1 answer
745 views

In Memory disk setup on SQL Server with below up snapshot_isolation_state snapshot_isolation_state_desc is_read_committed_snapshot_on is_memory_optimized_elevate_to_snapshot_on ...
Sean McKinney's user avatar
1 vote
2 answers
2k views

SOLVED: This error came from a table being locked through the open transaction and the other function call tried to wait for the unlock until it timed out. I'm currently working on an Azure Function ...
Maximilian Riegler's user avatar
2 votes
0 answers
225 views

ASP.NET Core 7 EF Core 7 SQL Server I have a routine that wants to perform multiple steps that involve calling DbContext.SaveChanges(). Thus, the routine wants to wrap all its work in a transaction. ...
Bob.at.Indigo.Health's user avatar
0 votes
1 answer
102 views

I have a complex application and encountered an error. I simplified my real problem with the following code. I have a WCF Service with a method that performs a select on one of my tables: public ...
Masoud's user avatar
  • 8,246
0 votes
2 answers
98 views

If the ROLLBACK is out of scope because of the Catch block, assuming that is the cause, how am I supposed to resolve other than putting all the saves in a single method? SqlConnection connection = new ...
Steve S's user avatar
  • 89
0 votes
1 answer
411 views

In my scenario, I have a method called GetEntries that invokes another method called Get within a transaction scope. Get method contains three LINQ queries. The first query retrieves a single ...
Ram Nivas's user avatar
  • 142
0 votes
1 answer
80 views

I have data which needs to be saved in two components (A, B). Component C talks to B using WCF and talks to A using .Net Remoting. Since C talks to B using WCF I am using TransactionScope (Issue in ...
VinayVelugu's user avatar
1 vote
1 answer
207 views

I am calculating rankings for an entire 300 event season base off teams and games played. This means updating a ranking from oldest event to newest every night for ELO ratings. We are using a ...
Mike Flynn's user avatar
  • 23.4k
1 vote
1 answer
4k views

I am using the transaction scope from System.Transactions. I have this method where I have two insertions in database. The first Localization is inserted, but then rolled back since it fails on the ...
MatejDodevski's user avatar
1 vote
1 answer
705 views

In production all of the sudden we started to have Exception message was "A TransactionScope must be disposed on the same thread that it was created.". Looking into code it was clear we are ...
yo chauhan's user avatar
  • 12.4k
2 votes
0 answers
392 views

Trying to persist some data in MongoDB and publish a couple of messages to Kafka everything inside of a transaction. I was thinking of using the dotnet TransactionScope but I do not see how to apply ...
101000101's user avatar
3 votes
2 answers
1k views

I have a multi-tenant application. The tenants data is isolated based on schema. I want to implement a transactional outbox pattern, where I want to store the events in a table (in same transaction)...
Kumar's user avatar
  • 1,676
0 votes
1 answer
548 views

My problem is related to the undoing of the actions I have done when the error is received. In the project that I am developing on .Net core 5, I can undo these transactions with Transection scope ...
Onur GOZ's user avatar
0 votes
1 answer
1k views

I am new to Entity framework core but have used Nhibernate and Java Hibernate for years and I'd like to bind DbContext to transaction scope. So method calls from service layer to business layers for a ...
Gengis's user avatar
  • 41
1 vote
1 answer
3k views

Using Azure.Messaging.ServiceBus. I want to send multiple messages to Azure Service Bus in one transaction. I'm fine with the limit of 100 messages per transaction. What are the pros and cons of these ...
AleksG's user avatar
  • 370
2 votes
1 answer
3k views

Say I have the following UnitOfWork which can be injected into handlers and used to perform db operations within TransactionScope: internal sealed class UnitOfWork : IUnitOfWork { private readonly ...
Bassie's user avatar
  • 10.5k
0 votes
0 answers
334 views

When connecting to some databases, I get the following error message when opening a connection. The caller is a TransactionScope. From the app: MTSRMManager.CCPEnlistDistributedTxnToSysTxn(...
Vincent's user avatar
  • 540
0 votes
0 answers
774 views

The code shown here worked fine without any error on quality site, but the same code is causing an error The Transaction has aborted on the production site. The error occurs on dispose of the scope. ...
KeDaR's user avatar
  • 81

1
2 3 4 5
22