93 lines
2 KiB
C#
93 lines
2 KiB
C#
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
|
|
}
|
|
}
|