public UtlConnection(UtlConnection connection) : this(connection.ConnectionString) { if (connection.State == ConnectionState.Open) { this.Open(); } }
public UtlConnectionProxy(UtlConnectionOptions connectionOptions, UtlConnection owner) { this.ConnectionOptions = connectionOptions; this.Owner = owner; this.Created = DateTime.UtcNow.Ticks; this.IsPooled = false; }
public UtlConnectionProxy(ISessionInterface sessionProxy, UtlConnectionOptions connectionOptions, UtlConnection owner) { this.SessionProxy = sessionProxy; this.ConnectionOptions = connectionOptions; this.Owner = owner; this.Created = DateTime.UtcNow.Ticks; this.IsPooled = false; }
public void BeginTransaction(UtlConnection connection, System.Data.IsolationLevel isolationLevel, bool readOnly) { this.Conn = connection; this._isolationLevel = isolationLevel; this._readOnly = readOnly; this.IsValid(true); this._oldAutoCommit = this.Conn.AutoCommit; this.Conn.AutoCommit = false; this.SetTransactionCharacteristics(); }
private static string BuildStoredProcedureSql(string spName, UtlConnection connection) { StringBuilder builder = new StringBuilder(); builder.Append("CALL ").Append(spName).Append("( "); string schema = null; BreakName2SchemaSP(spName, ref schema, ref spName); if (spName.StartsWith("\"") && spName.EndsWith("\"")) { spName = spName.Substring(1, spName.Length - 2); } if (((schema != null) && schema.StartsWith("\"")) && schema.EndsWith("\"")) { schema = schema.Substring(1, schema.Length - 2); } string[] restrictionValues = new string[3]; restrictionValues[1] = schema; restrictionValues[2] = spName; DataTable table = connection.GetSchema("PROCEDUREPARAMETERS", restrictionValues); if (table.Rows.Count == 0) { string[] textArray2 = new string[3]; textArray2[1] = schema; textArray2[2] = spName; if (connection.GetSchema("PROCEDURES", textArray2).Rows.Count == 0) { string[] textArray3 = new string[3]; textArray3[1] = schema; textArray3[2] = spName.ToUpper(); table = connection.GetSchema("PROCEDUREPARAMETERS", textArray3); } } for (int i = 0; i < table.Rows.Count; i++) { string str2 = (string)table.Rows[i]["COLUMN_NAME"]; if (str2.StartsWith("@")) { builder.Append(str2); } else { builder.Append("@").Append(str2); } if (i != (table.Rows.Count - 1)) { builder.Append(" , "); } } builder.Append(" );"); return(builder.ToString()); }
public override void Close() { if ((this.State != ConnectionState.Closed) && (this.InnerConnection != null)) { if (this.InnerConnection.IsEnlisted) { UtlConnection connection = new UtlConnection { InnerConnection = this.InnerConnection }; connection.InnerConnection.Owner = connection; connection.ConnectionString = this.ConnectionString; connection._connectionOptions = this._connectionOptions; connection.Version = this.Version; connection._connectionState = this._connectionState; connection.InnerConnection.Enlistment.DbTransaction.Conn = connection; connection.InnerConnection.Enlistment.DisposeConnection = true; this.InnerConnection = null; } try { if (this.InnerConnection != null) { lock (this.InnerConnection) { this.InnerConnection.DisposeTransaction(); this.InnerConnection.Owner = null; if (this._connectionOptions.Pooling) { UtlConnectionPool.Add(this._connectionString, this.InnerConnection, this._poolVersion); } else { this.InnerConnection.Dispose(); } } } this.InnerConnection = null; } catch (Exception) { } finally { this.OnStateChange(ConnectionState.Closed); } } }
public override void Commit() { this.IsValid(true); UtlConnection conn = Interlocked.Exchange <UtlConnection>(ref this.Conn, null); try { conn.InnerConnection.SessionProxy.Commit(true); } catch (CoreException exception1) { UtlException.ThrowError(exception1); } finally { this.RestoreAutoCommit(conn); } this.IsCompleted = true; }
public void IssueRollback() { UtlConnection conn = Interlocked.Exchange <UtlConnection>(ref this.Conn, null); if (conn != null) { try { conn.InnerConnection.SessionProxy.Rollback(true); } catch (CoreException exception1) { UtlException.ThrowError(exception1); } finally { this.RestoreAutoCommit(conn); } } }
public UtlCommand(string commandText, UtlConnection connection, UtlTransaction transaction) { this._commandTimeout = 30; this._commandType = System.Data.CommandType.Text; this._parameterCollection = new UtlParameterCollection(this); this._designTimeVisible = true; this._updateRowSource = UpdateRowSource.None; if (commandText != null) { this.CommandText = commandText; } if (connection != null) { this.DbConnection = connection; } if (transaction != null) { this.Transaction = transaction; } this.FetchGeneratedResults = false; }
public void Close() { if (!this._isClrSpConnection && (this.SessionProxy != null)) { try { this.SessionProxy.Close(); } catch (Exception) { } finally { this.SessionProxy = null; this.Owner = null; this.IsPooled = false; this.Created = 0L; this.ConnectionOptions = null; } } }
public UtlDataAdapter(string commandText, string connectionString) { UtlConnection connection = new UtlConnection(connectionString); this.SelectCommand = new UtlCommand(commandText, connection); }
public UtlDataAdapter(string commandText, UtlConnection connection) { this.SelectCommand = new UtlCommand(commandText, connection); }
public UtlTransaction(UtlConnection connection, System.Data.IsolationLevel isolationLevel, bool readOnly) { this.BeginTransaction(connection, isolationLevel, readOnly); }
private void RestoreAutoCommit(UtlConnection conn) { conn.AutoCommit = this._oldAutoCommit; }
public static void ClearPool(UtlConnection connection) { UtlConnectionPool.ClearPool(connection.ConnectionString); }
public UtlMetaData(UtlConnection cnn) { this._cnn = cnn; }
public UtlCommand(string commandText, UtlConnection connection) : this(commandText, connection, null) { }
public UtlCommand(UtlConnection connection) : this(null, connection, null) { }