End Google Ads 201810 - BS.net 01 --> hello

I ran into this error message while before/while/after insert into ShopMessage...


Message "Cannot access a disposed object.\r\nObject name: 'Transaction'." string


I'm using TransactionScope with timeout set to zero (i.e. infinite). Googled a bit still quite clueless.

This is how I wrap Database calls in TransactionScope


using (oScope = new TransactionScope(TransactionScopeOption.Required, TimeSpan.FromMilliseconds(0)))
{
// Here we have some ADO.NET calls + some NHibernate calls.
nGeneratedId = SaveCoreOperations(ref oShop);
oScope.Complete();
}


Here's the stack trace

at System.Transactions.Transaction.get_IsolationLevel()
at System.Data.SqlClient.SqlDelegatedTransaction..ctor(SqlInternalConnection connection, Transaction tx)
at System.Data.SqlClient.SqlInternalConnection.EnlistNonNull(Transaction tx)
at System.Data.SqlClient.SqlInternalConnection.Enlist(Transaction tx)
at System.Data.SqlClient.SqlInternalConnectionTds.Activate(Transaction transaction)
at System.Data.ProviderBase.DbConnectionInternal.ActivateConnection(Transaction transaction)
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at NHibernate.Connection.DriverConnectionProvider.GetConnection()
at NHibernate.Impl.SessionFactoryImpl.OpenConnection()


Any idea?

dev