TMedConnection.StartTransaction TMedConnection

procedure StartTransaction(timeout: Integer=0);

Description

Mediator server only. Not applicable to DBF files.

The command designates the beginning of SQL database transaction. The optional timeout parameter allows to specify the time in milliseconds of waiting for access to resources locked by other transactions. No time-out specified means unlimited time of waiting for access.

Transaction should be completed by committing it (Commit) or rolling it back (Rollback). If the program begins a transaction but does not commit it, the transaction will be rolled back regardless of correct termination of program. In case of any error, transaction will be rolled back by the server and SRV/1400 error will be reported via EHbError exception. The transaction is also automatically rolled back in case of losing network connection with the server. Should this happen, NET/1301 error will be reported.

The following operations are not allowed during the transaction:

·Creating a table

·Creating an index

·Deleting a table

·Deleting an index

·Purging deleted records (HbDbPack method)

·Deleting table contents (HbDbZap method)

·Changing a table name (MedRenTab method)

·Creating a new marker table (MedMrkNew method)

·Marking all records (MedMrkAll method)

·Deleting all markers (MedUMrkAll method)

·Deleting a marker table (MedMrkRemv method)

·Executing SQL commands other than INSERT, UPDATE and DELETE