mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 11:09:42 +02:00
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:
parent
bb7aee5e8e
commit
1e3d48288c
@ -540,7 +540,7 @@ end;
|
||||
|
||||
function TMSSQLConnection.Rollback(trans: TSQLHandle): boolean;
|
||||
begin
|
||||
Execute('ROLLBACK');
|
||||
Execute('IF @@TRANCOUNT>0 ROLLBACK');
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user