Exemple #1
0
 private void Cleanup(UtlConnectionProxy cnn)
 {
     if (this.DisposeConnection || (!cnn.IsPooled && ((cnn.Owner == null) || cnn.Owner.IsClosed)))
     {
         cnn.Dispose();
     }
     this._transaction     = null;
     this._scope           = null;
     this._connectionProxy = null;
 }
Exemple #2
0
 public void DisposeTransaction()
 {
     if ((this.Transaction != null) && !this.IsEnlisted)
     {
         this.Transaction.Dispose();
         this.Transaction = null;
     }
     try
     {
         this.SessionProxy.Rollback(false);
     }
     catch (Exception)
     {
     }
 }
Exemple #3
0
 public UtlTransaction BeginTransaction(System.Data.IsolationLevel level, bool readOnly)
 {
     lock (this)
     {
         if (this.TransactionActive)
         {
             throw new InvalidOperationException("Transaction is already active.");
         }
         try
         {
             this.Transaction = new UtlTransaction(this.Owner, level, readOnly);
         }
         catch (CoreException exception1)
         {
             throw UtlException.GetException(exception1);
         }
     }
     return(this.Transaction);
 }
Exemple #4
0
 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;
 }
Exemple #5
0
        public UtlEnlistment(UtlConnectionProxy connectionProxy, Transaction scope)
        {
            this._scope           = scope;
            this._connectionProxy = connectionProxy;
            System.Data.IsolationLevel readCommitted = System.Data.IsolationLevel.ReadCommitted;
            switch (this._scope.IsolationLevel)
            {
            case System.Transactions.IsolationLevel.Serializable:
                readCommitted = System.Data.IsolationLevel.Serializable;
                break;

            case System.Transactions.IsolationLevel.RepeatableRead:
                readCommitted = System.Data.IsolationLevel.RepeatableRead;
                break;

            case System.Transactions.IsolationLevel.ReadCommitted:
                readCommitted = System.Data.IsolationLevel.ReadCommitted;
                break;

            case System.Transactions.IsolationLevel.ReadUncommitted:
                readCommitted = System.Data.IsolationLevel.ReadUncommitted;
                break;

            case System.Transactions.IsolationLevel.Snapshot:
                readCommitted = System.Data.IsolationLevel.Snapshot;
                break;

            case System.Transactions.IsolationLevel.Chaos:
                readCommitted = System.Data.IsolationLevel.Chaos;
                break;

            case System.Transactions.IsolationLevel.Unspecified:
                readCommitted = System.Data.IsolationLevel.Unspecified;
                break;
            }
            this._transaction = this._connectionProxy.BeginTransaction(readCommitted);
            this._scope       = scope;
            this._scope.EnlistVolatile(this, EnlistmentOptions.None);
        }