Skip to content

Commit

Permalink
Temporarily dispose commands synchronously
Browse files Browse the repository at this point in the history
Seems to cause EntryPointNotFoundException somehow...
We're also not disposing commands asynchronously elsewhere at
the moment.
  • Loading branch information
roji committed Apr 22, 2020
1 parent 550833b commit b4703a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/EFCore.SqlServer/Storage/Internal/SqlServerTransaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public override void Save(string savepointName)
/// <inheritdoc />
public override async Task SaveAsync(string savepointName, CancellationToken cancellationToken = default)
{
await using var command = Connection.DbConnection.CreateCommand();
using var command = Connection.DbConnection.CreateCommand();
command.Transaction = _dbTransaction;
command.CommandText = "SAVE TRANSACTION " + savepointName;
await command.ExecuteNonQueryAsync(cancellationToken);
Expand All @@ -60,7 +60,7 @@ public override void Rollback(string savepointName)
/// <inheritdoc />
public override async Task RollbackAsync(string savepointName, CancellationToken cancellationToken = default)
{
await using var command = Connection.DbConnection.CreateCommand();
using var command = Connection.DbConnection.CreateCommand();
command.Transaction = _dbTransaction;
command.CommandText = "ROLLBACK TRANSACTION " + savepointName;
await command.ExecuteNonQueryAsync(cancellationToken);
Expand Down
6 changes: 3 additions & 3 deletions src/EFCore.Sqlite.Core/Storage/Internal/SqliteTransaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public override void Save(string savepointName)
/// <inheritdoc />
public override async Task SaveAsync(string savepointName, CancellationToken cancellationToken = default)
{
await using var command = Connection.DbConnection.CreateCommand();
using var command = Connection.DbConnection.CreateCommand();
command.Transaction = _dbTransaction;
command.CommandText = "SAVEPOINT " + savepointName;
await command.ExecuteNonQueryAsync(cancellationToken);
Expand All @@ -60,7 +60,7 @@ public override void Rollback(string savepointName)
/// <inheritdoc />
public override async Task RollbackAsync(string savepointName, CancellationToken cancellationToken = default)
{
await using var command = Connection.DbConnection.CreateCommand();
using var command = Connection.DbConnection.CreateCommand();
command.Transaction = _dbTransaction;
command.CommandText = "ROLLBACK TO " + savepointName;
await command.ExecuteNonQueryAsync(cancellationToken);
Expand All @@ -78,7 +78,7 @@ public override void Release(string savepointName)
/// <inheritdoc />
public override async Task ReleaseAsync(string savepointName, CancellationToken cancellationToken = default)
{
await using var command = Connection.DbConnection.CreateCommand();
using var command = Connection.DbConnection.CreateCommand();
command.Transaction = _dbTransaction;
command.CommandText = "RELEASE " + savepointName;
await command.ExecuteNonQueryAsync(cancellationToken);
Expand Down

0 comments on commit b4703a7

Please sign in to comment.