msdtc

Is it possible to have a distributed transaction with IBM MQ and SQL Server in .NET5?

不问归期 提交于 2021-01-29 15:47:12
问题 We are thinking of migrating from .NET Framework 4.0 to .NET 5. In our code we often get a message from an IBM MQ Queue and write it to the database in one transaction, or we read and update the database and write to an IBM MQ Queue in one transaction. The code runs on Windows Server 2012, the database is SQL Server 2016 and we have IBM Websphere version 8.0. The distributed transactions are coordinated by MSDTC. Is it possible to do the same with .NET 5? As far as I know, .NET 5 does not

.NET TransactionScope and MSDTC

时光总嘲笑我的痴心妄想 提交于 2021-01-27 06:22:46
问题 In my code there are transactions to handle: using (var scope = new TransactionScope()) { repo1.SaveSomething(); repo2.SaveAnythingElse(); scope.Complete(); } Inside repo1 and repo2 functions create their own db context with using, and dispose them, the transactions worked like a charm. Now I add another code like this, and it begins to drop an exception: The underlying provider failed on Open. (EntityFramework) Network access for Distributed Transaction Manager (MSDTC) has been disabled.

Using TransactionScope with Stored Procedure Transaction does not work

耗尽温柔 提交于 2020-12-13 03:32:35
问题 As per my understanding, C# TransactionScope can still work when wrapping a T-SQL BEGIN / COMMIT TRANSACTION inside a stored procedure. I have the following C# method which does EF Save first, then call a stored procedure that has its own transaction and then call external service over HTTP public async Task DoSomething(MyDto dto) { using (var scope = new TransactionScope()) { //Save First var myEntity = await _dbContext.MyEntity.Where(x=>x.Id == dto.Id).SingleOtDefaultAsync(); // Assign

Using TransactionScope with Stored Procedure Transaction does not work

橙三吉。 提交于 2020-12-13 03:30:39
问题 As per my understanding, C# TransactionScope can still work when wrapping a T-SQL BEGIN / COMMIT TRANSACTION inside a stored procedure. I have the following C# method which does EF Save first, then call a stored procedure that has its own transaction and then call external service over HTTP public async Task DoSomething(MyDto dto) { using (var scope = new TransactionScope()) { //Save First var myEntity = await _dbContext.MyEntity.Where(x=>x.Id == dto.Id).SingleOtDefaultAsync(); // Assign

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 throws TransactionAbortedException when Disposed

岁酱吖の 提交于 2020-01-17 03:55:28
问题 I have the following scenario: Parent process start TransactionScope, a token identifying the transaction is created using TransactionInterop.GetTransmitterPropagationToken, inserts data to database. TransactionScope completes. Another process is started, using the above mentioned token it creates Transaction which is then used to create TransactionScope. This process also inserts data to database. TransactionScope completes and is disposed. Parent process tries to dispose its

TransactionScope throws TransactionAbortedException when Disposed

限于喜欢 提交于 2020-01-17 03:55:26
问题 I have the following scenario: Parent process start TransactionScope, a token identifying the transaction is created using TransactionInterop.GetTransmitterPropagationToken, inserts data to database. TransactionScope completes. Another process is started, using the above mentioned token it creates Transaction which is then used to create TransactionScope. This process also inserts data to database. TransactionScope completes and is disposed. Parent process tries to dispose its

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()) {