[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'DB' (#fcl)

# TDBTransaction

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Encapsulate a transaction

## Declaration

Source position: db.pas line 1960

`type TDBTransaction = class(TComponent)`
`public`
`constructor Create(); override;` |  | Transaction property
`destructor Destroy; override;` |  | Remove a TDBTransaction instance from memory.
`procedure CloseDataSets;` |  | Close all connected datasets
`property DataBase: TDataBase; [rw]` |  | Database this transaction is connected to
`published`
`property Active: Boolean; [rw]` |  | Is the transaction active or not
`end;`

## Inheritance

`TDBTransaction` |  | Encapsulate a transaction
`TComponent,IUnknown,IInterfaceComponentReference`
`TPersistent,IFPObserved`
`TObject`

## Description

TDBTransaction encapsulates a SQL transaction. It is an abstract class, and should be used by component creators that wish to encapsulate transactions in a class. The TDBTransaction class offers functionality to refer to a TDatabase instance, and to keep track of TDataset instances which are connected to the transaction.

## See also

TDatabase |  | Base class for connecting a FreePascal application to an external Database engine
TDataset |  | Base class for records-based data-access

Documentation generated on: May 14 2021