StartTransaction method

Applies to
TIB_Transaction

Declaration
Procedure StartTransaction;

Description
This method starts what I call an explicite logical transaction. It makes it so that the InTransaction property will return true. The explicite logical transaction remains until Commit, CommitRetaining, Rollback, RollbackRetaining, Close or Refresh() is called.

If AutoCommit is set to true then calling this method will temporarily suspend the auto committing behavior and allow all changes to be held within a logical transaction. Once the logical transaction is ended it will go back to the auto commit behavior again.

If StartTransaction has already been called then an exception will be raised so it may be a good idea to check the status of the InTransaction property prior to calling this method.

If StartTransaction is never called the InTransaction property will always return false even if changes are posted to the server or are pending.

It is possible to rely on the implicite logical transaction that IBO maintains for you automatically instead of calling StartTransaction. If AutoCommit is false use the TransactionIsActive property to determine whether or not something has actually been sent to the server (or is pending if a dataset is in an edit state) rather than the InTransaction property when doing this.