Check if database supports transactions using FireDac
How to check if the DBMS supports transactions using FireDac components?
I usually use something like the following code to perform a transaction in my DAO class using dbExpress.
...
connection: TSQLConnection;
dbxTransaction: TDBXTransaction;
...
if (connection.TransactionsSupported) AND ((not connection.InTransaction) OR (connection.MultipleTransactionsSupported)) then
begin
dbxTransaction := connection.BeginTransaction(TDBXIsolations.ReadCommitted);
end;
So what are the properties of correspondents in FireDac that I use in dbExpress: TransactionsSupported
InTransaction
MultipleTransactionsSupported
Thanks in advance.
+3
rodrigopandini
source
to share
1 answer
- TransactionsSupported - TFDConnection.ConnectionMetaDataIntf.TxSupported
- InTransaction - TFDConnection.InTransaction
- MultipleTransactionsSupported - TFDConnection.ConnectionMetaDataIntf.TxMultiple
+6
da-soft
source
to share