Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove detecting outside transaction.
- Previously we detected outside transactions using System.Transaction, but recently
  we overcame the issue using specific configuration of the PgSql devart provider.
  It's redundant code now and should be removed to make everything consistent
  with the rest of the code.
  • Loading branch information
raol committed Mar 4, 2016
commit 8601958c39e2d79133c9f7befed0ed4c9f81f6f0
8 changes: 2 additions & 6 deletions Source/EntityFramework.Extended/Batch/PgSqlBatchRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,12 @@ private int InternalDelete<TEntity>(ObjectContext objectContext, EntityMap entit
ownConnection = true;
}

// When in TransactionScope PostgreSQL does not allow to create nested transaction
if (deleteTransaction == null && System.Transactions.Transaction.Current == null)
if (deleteTransaction == null)
{
deleteTransaction = deleteConnection.BeginTransaction();
ownTransaction = true;
}


deleteCommand = deleteConnection.CreateCommand();
deleteCommand.Transaction = deleteTransaction;
if (objectContext.CommandTimeout.HasValue)
Expand Down Expand Up @@ -213,9 +211,7 @@ private int InternalUpdate<TEntity>(ObjectContext objectContext, EntityMap entit
ownConnection = true;
}

// use existing transaction or create new
// When in TransactionScope PostgreSQL does not allow to create nested transaction
if (updateTransaction == null && System.Transactions.Transaction.Current != null)
if (updateTransaction == null)
{
updateTransaction = updateConnection.BeginTransaction();
ownTransaction = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
<Reference Include="System.Core" />
<Reference Include="System.Runtime.Caching" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Transactions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
Expand Down