i've added two components to a form: TMSConnection and TMSScript
The AutoCommit property of the TMSConnection component is set to false.
In design mode i try to execute the following two statements in the TMSScript Editor:
Code: Select all
UPDATE AdventureWorks2014.HumanResources.Employee
SET
VacationHours = 98
WHERE
BusinessEntityID = 1;
COMMIT;
That is an unexpected behavior of the TMSConnection component for me, because i've set the AutoCommit property to false and the update statement starts the transaction implicit,The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION
During runtime i set a breakpoint at the AfterExecute-TMSScript event and check the transaction state:
After the above UPDATE Statement the session wasn't in transaction !! ( MSConnection1->InTransaction ) What should i do, if want to execute SQL scripts with COMMIT or ROLLBACK statements ?
In this case MSConnection1->StartTransaction doesn't work.
Best regards
C++Builder 10.1 Update 1
SDAC 7.3.16 Professional Edition / Direct Connection Mode