IConnectionTransaction.Commit

Syntax

Commit;

Description

The Commit method saves all changes on the database server and finishes transaction.

Comments

When slice data is saved, which data source is a standard cube, the saving is executed within the external transaction.

Example

Sub Main;
Var
   MB: IMetabase;
    DB: IDatabaseInstance;
    Connect: ISecurityConnection;
    Command: IDalCommand;
    Tran: IConnectionTransaction;
Begin
    MB := MetabaseClass.Active;
    DB := MB.ItemById("BD").Open(NullAs IDatabaseInstance;
    Connect := DB.Connection;
    Command := Connect.CreateCommand("Insert Into Table_1 values ('A',1)");
    Tran := Connect.StartTransaction(False);
Try
    Command.Execute;
    Tran.Commit;
Except
    Tran.Rollback;
End Try;
    Command.Close;
End Sub Main;

After executing the example, connection to the DB server, on which the BD repository database is set, established. The SQL query that inserts a new record in the table with the Table_1 physical name is created and executed. If there is any unsaved data, it is saved on the server.

See also:

IConnectionTransaction