Description
Hello all,
I would like to ask about why in the documentation is explicit about opening an async connection but not about closing and disposing it async, the examples also don't show this so I'm curious about it.
Another question I have is related to an error I'm experiencing since December and it is that I'm getting in my code XA_RBDEADLOCK while using oracle and mysql in the same transaction that I open like this:
using (var transaction = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled))
using (await _oracleConnectionManager.OpenConnection())
using (await _mySqlConnectionManager.OpenConnection())
While opening the connection I enlist the transaction
if (Transaction.Current != null)
{
_connection.EnlistTransaction(Transaction.Current);
}
And later when trying to dispose the connection I get XA_RBDEADLOCK .
It doesn't happens always but when it happens it also blocks Oracle tables.
It's very hard to test and actually I wasn't able to reproduce the error, so it just happens from time to time by itself.
I had this code running for 1 year without any issues and the error is always in the same path, so I don't think it's related to the library itself.
My question is the following: In the documentation it said that we should use MySqlConnection.BeginTransactionAsync, CommitAsync and RollbackAsync but if I'm using the TransactionScope this should be implicit in .NET Core code?
Could be a problem with a connection leaking, the transaction being block?
Thank you for your help!