forked from MRCollective/ReliableDbProvider
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug Fix : Failure when executing SQL string MRCollective#7
- Loading branch information
1 parent
e77528b
commit 313fd85
Showing
5 changed files
with
135 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
using System; | ||
using System.Data; | ||
using System.Data.Common; | ||
using System.Data.SqlClient; | ||
|
||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace ReliableDbProvider | ||
{ | ||
/// <summary> | ||
/// This class just wraps a Dbtransaction and prevents our SqlConnection from being leaked to the outside world | ||
/// </summary> | ||
public class ReliableSqlDbTransaction : DbTransaction | ||
{ | ||
readonly ReliableSqlDbConnection innerConnection; | ||
readonly SqlTransaction innerTransaction; | ||
|
||
internal SqlTransaction InnerTransaction { get { return innerTransaction; } } | ||
|
||
public ReliableSqlDbTransaction(ReliableSqlDbConnection connection, SqlTransaction transaction) | ||
{ | ||
this.innerConnection = connection; | ||
this.innerTransaction = transaction; | ||
} | ||
public override void Commit() | ||
{ | ||
innerTransaction.Commit(); | ||
} | ||
|
||
protected override DbConnection DbConnection | ||
{ | ||
get { return innerConnection; } | ||
} | ||
|
||
public override System.Data.IsolationLevel IsolationLevel | ||
{ | ||
get { return innerTransaction.IsolationLevel; } | ||
} | ||
|
||
public override void Rollback() | ||
{ | ||
innerTransaction.Rollback(); | ||
} | ||
|
||
protected override void Dispose(bool disposing) | ||
{ | ||
innerTransaction.Dispose(); | ||
base.Dispose(disposing); | ||
} | ||
|
||
} | ||
} |