fcl-db: mssql: make Rollback more safe. Check if there is active transaction first to avoid error "The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION."

Sometimes SQL Server automaticaly rollbacks transaction and then raises error ...
ODBC driver does same: IF @@TRANCOUNT>0 ROLLBACK.

git-svn-id: trunk@29430 -
This commit is contained in:
lacak 2015-01-09 13:33:02 +00:00
parent bb7aee5e8e
commit 1e3d48288c

View File

@ -540,7 +540,7 @@ end;
function TMSSQLConnection.Rollback(trans: TSQLHandle): boolean;
begin
Execute('ROLLBACK');
Execute('IF @@TRANCOUNT>0 ROLLBACK');
Result:=true;
end;