init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
93
Sda.DataProvider/SDATransaction.cs
Normal file
93
Sda.DataProvider/SDATransaction.cs
Normal file
|
@ -0,0 +1,93 @@
|
|||
using System;
|
||||
using System.Data;
|
||||
using SDA.DataProvider.Core;
|
||||
|
||||
namespace SDA.DataProvider
|
||||
{
|
||||
/// <summary>
|
||||
/// Adatbázis-ügylet
|
||||
/// </summary>
|
||||
public class SDATransaction : IDbTransaction
|
||||
{
|
||||
internal SDATransactionWrapper Transaction;
|
||||
|
||||
internal SDATransaction(SDATransactionWrapper transaction)
|
||||
{
|
||||
Transaction = transaction;
|
||||
}
|
||||
|
||||
bool _disposed;
|
||||
|
||||
/// <summary>
|
||||
/// Explicit destruktor.
|
||||
/// </summary>
|
||||
/// <param name="disposing">Programozott felszabadítás?</param>
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (_disposed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (disposing)
|
||||
{
|
||||
if (Transaction != null)
|
||||
{
|
||||
Transaction.Dispose();
|
||||
Transaction = null;
|
||||
}
|
||||
}
|
||||
_disposed = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Eldobja az ügyletet.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
#region IDbTransaction Members
|
||||
|
||||
/// <summary>
|
||||
/// Az ügylethez tartozó adatbázis-kapcsolat.
|
||||
/// </summary>
|
||||
public IDbConnection Connection
|
||||
{
|
||||
get
|
||||
{
|
||||
return Transaction.Connection;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Az elválasztás szintje.
|
||||
/// </summary>
|
||||
public IsolationLevel IsolationLevel
|
||||
{
|
||||
get
|
||||
{
|
||||
return Transaction.IsolationLevel;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elköveti az ügyletet.
|
||||
/// </summary>
|
||||
public void Commit()
|
||||
{
|
||||
Transaction.Commit();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Visszagörgeti az ügyletet.
|
||||
/// </summary>
|
||||
public void Rollback()
|
||||
{
|
||||
Transaction.Rollback();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue