mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-18 12:31:30 -10:00
* list:
Add new internal tds classes
* System.Data.Common/DbDataAdapter.cs:
* System.Data.SqlClient/SqlDataAdapter.cs:
Change event calling system
* System.Data.SqlClient/SqlClientPermission.cs:
* System.Data.SqlClient/SqlClientPermissionAttribute.cs:
* System.Data.SqlClient/SqlDataReader.cs:
Add comments
* System.Data.SqlClient/SqlCommand.cs:
Some changes to make consistent with .NET based on Sql server traces
Implement command timeout
* System.Data.SqlClient/SqlCommandBuilder.cs:
Make sure that we only build a command if key info found
* System.Data.SqlClient/SqlConnection.cs:
Change event calling system
Some changes to make consistent with .NET based on Sql server traces
Implement connection timeout
* System.Data.SqlClient/SqlConnectionPool.cs:
Implement connection timeout
* System.Data.SqlClient/SqlError.cs:
Implement ToString ()
* System.Data.SqlClient/SqlException.cs:
Mucho implementation and cleanup
* System.Data.SqlClient/SqlParameter.cs:
Implement Clone ()
* System.Data.SqlClient/SqlParameterCollection.cs:
Code cleanup
* System.Data.SqlClient/SqlTransaction.cs:
Move some of the transaction creation to SqlConnection to be consistent
with .NET SQL traces
svn path=/trunk/mcs/; revision=8906
100 lines
1.9 KiB
C#
100 lines
1.9 KiB
C#
//
|
|
// System.Data.SqlClient.SqlTransaction.cs
|
|
//
|
|
// Author:
|
|
// Tim Coleman ([email protected])
|
|
//
|
|
// Copyright (C) Tim Coleman, 2002
|
|
//
|
|
|
|
using Mono.Data.TdsClient;
|
|
using System;
|
|
using System.Data;
|
|
using System.Data.Common;
|
|
|
|
namespace System.Data.SqlClient {
|
|
public sealed class SqlTransaction : MarshalByRefObject, IDbTransaction, IDisposable
|
|
{
|
|
#region Fields
|
|
|
|
SqlConnection connection;
|
|
IsolationLevel isolationLevel;
|
|
bool isOpen;
|
|
|
|
#endregion
|
|
|
|
#region Constructors
|
|
|
|
internal SqlTransaction (SqlConnection connection, IsolationLevel isolevel)
|
|
{
|
|
this.connection = connection;
|
|
this.isolationLevel = isolevel;
|
|
isOpen = true;
|
|
}
|
|
|
|
#endregion // Constructors
|
|
|
|
#region Properties
|
|
|
|
public SqlConnection Connection {
|
|
get { return connection; }
|
|
}
|
|
|
|
internal bool IsOpen {
|
|
get { return isOpen; }
|
|
}
|
|
|
|
public IsolationLevel IsolationLevel {
|
|
get { return isolationLevel; }
|
|
}
|
|
|
|
IDbConnection IDbTransaction.Connection {
|
|
get { return Connection; }
|
|
}
|
|
|
|
#endregion // Properties
|
|
|
|
#region Methods
|
|
|
|
public void Commit ()
|
|
{
|
|
if (!isOpen)
|
|
throw new InvalidOperationException ("The Transaction was not open.");
|
|
connection.Tds.ExecuteNonQuery ("COMMIT TRANSACTION");
|
|
connection.Transaction = null;
|
|
isOpen = false;
|
|
}
|
|
|
|
private void Dispose (bool disposing)
|
|
{
|
|
}
|
|
|
|
public void Dispose ()
|
|
{
|
|
Dispose (true);
|
|
}
|
|
|
|
public void Rollback ()
|
|
{
|
|
Rollback (String.Empty);
|
|
}
|
|
|
|
public void Rollback (string transactionName)
|
|
{
|
|
if (!isOpen)
|
|
throw new InvalidOperationException ("The Transaction was not open.");
|
|
connection.Tds.ExecuteNonQuery (String.Format ("ROLLBACK TRANSACTION {0}", transactionName));
|
|
isOpen = false;
|
|
}
|
|
|
|
public void Save (string savePointName)
|
|
{
|
|
if (!isOpen)
|
|
throw new InvalidOperationException ("The Transaction was not open.");
|
|
connection.Tds.ExecuteNonQuery (String.Format ("SAVE TRANSACTION {0}", savePointName));
|
|
}
|
|
|
|
#endregion // Methods
|
|
}
|
|
}
|