示例#1
0
        public void Commit()
        {
            lock (this.db)
            {
                if (this.state != TransactionState.TransactionStarted &&
                    this.state != TransactionState.TransactionPrepared)
                {
                    throw new IscException(
                              IscCodes.isc_arg_gds,
                              IscCodes.isc_tra_state,
                              this.handle,
                              "no valid");
                }

                this.state = TransactionState.TransactionCommiting;

                int[] statusVector = FesConnection.GetNewStatusVector();
                int   trHandle     = this.handle;

                FbClient.isc_commit_transaction(statusVector, ref trHandle);

                this.handle = trHandle;

                this.db.ParseStatusVector(statusVector);

                this.db.TransactionCount--;

                if (this.Update != null)
                {
                    this.Update(this, new EventArgs());
                }

                this.state = TransactionState.NoTransaction;
            }
        }