Exemple #1
0
        /// <summary>
        /// ROLLBACK TRANSACTION
        /// Rollback to level 0.
        /// </summary>
        public virtual void RollbackTransaction()
        {
            this.Tracer.TraceVerbose("rollback transaction");
            if (null == this.outerTransaction)
            {
                this.SqlExecutionError("Invalid ROLLBACK TRANSACTION: not in a transaction");
            }

            this.CloseCachedTable();
            this.outerTransaction.Rollback();
            this.savepoints.Clear();
            this.outerTransaction = null;
        }
Exemple #2
0
        /// <summary>
        /// BEGIN TRANSACTION
        /// Begin from level 0.
        /// </summary>
        public virtual void BeginTransaction()
        {
            this.Tracer.TraceVerbose("begin transaction");
            if (null != this.outerTransaction)
            {
                this.SqlExecutionError("Invalid BEGIN TRANSACTION: already in a transaction");
            }

            this.outerTransaction = this.Connection.BeginTransaction();
        }
Exemple #3
0
        /// <summary>
        /// COMMIT TRANSACTION
        /// Commit to level 0.
        /// </summary>
        public virtual void CommitTransaction()
        {
            this.Tracer.TraceVerbose("commit transaction");
            if (null == this.outerTransaction)
            {
                this.SqlExecutionError("Invalid COMMIT TRANSACTION: not in a transaction");
            }

            this.CloseCachedTable();
            this.outerTransaction.Commit();
            this.savepoints.Clear();
            this.outerTransaction = null;
        }
 public void Setup()
 {
     this.connection = Esent.OpenDatabase(database);
     this.transaction = this.connection.BeginTransaction();
     this.table = this.connection.OpenTable(tablename);
 }