public virtual DatabaseTransactionContextAcquisition AcquirePersistenceTransactionContext(SqlDatabaseContext sqlDatabaseContext)
{
SqlTransactionalCommandsContext retval;
if (this.Transaction == null)
{
retval = sqlDatabaseContext.CreateSqlTransactionalCommandsContext(null);
return new DatabaseTransactionContextAcquisition(this, sqlDatabaseContext, retval);
}
else
{
TransactionEntry outValue;
if (this.persistenceTransactionContextsBySqlDatabaseContexts.TryGetValue(sqlDatabaseContext, out outValue))
{
retval = outValue.sqlDatabaseCommandsContext;
}
else
{
retval = sqlDatabaseContext.CreateSqlTransactionalCommandsContext(this.Transaction);
this.persistenceTransactionContextsBySqlDatabaseContexts[sqlDatabaseContext] = new TransactionEntry(retval);
}
return new DatabaseTransactionContextAcquisition(this, sqlDatabaseContext, retval);
}
}