MyDump / MyScript with Commit/Rollback
Posted: Thu 16 Oct 2008 17:00
Hello.
I want to restore a dump made by MyDump : it's a big SQL file with only INSERT instructions (no Lock/unlock).
But before this, I want to execute :
* lock tables instructions
* delete instructions for tables in the database with MyScript component
And restore of the dump
And :
* unlock tables instruction
This is OK.
If an error occur in the restore, I do a Rollback, and this rollback not work.
I do this :
* MyConnection1.StartTransaction;
* MyScript1.AutoCommit := False;
* MyScript1.SQL :=
* MyScript1.Execute
* MyScript1.ExecuteFile()
* MyConnection1.Rollback;
* MyScript1.SQL :=
* MyScript1.Execute
And the restore is realised !
But I want no restore (Rollback instruction).
It's the same problem with MyDump component.
I want to restore a dump made by MyDump : it's a big SQL file with only INSERT instructions (no Lock/unlock).
But before this, I want to execute :
* lock tables instructions
* delete instructions for tables in the database with MyScript component
And restore of the dump
And :
* unlock tables instruction
This is OK.
If an error occur in the restore, I do a Rollback, and this rollback not work.
I do this :
* MyConnection1.StartTransaction;
* MyScript1.AutoCommit := False;
* MyScript1.SQL :=
* MyScript1.Execute
* MyScript1.ExecuteFile()
* MyConnection1.Rollback;
* MyScript1.SQL :=
* MyScript1.Execute
And the restore is realised !
But I want no restore (Rollback instruction).
It's the same problem with MyDump component.