ora-01086 Error

delphi74u

Member
I am trying to use rollbacktosavepoint on my session object and get the following error:
ORA-01086: savepoint 'STARTIMPORT' never established.

My code is something like this

OracleSession1.Savepoint('StartImport');
try
...
if not IsDebug then
begin
if MessageDlg('Save Imported data?',mtInformation,[mbYes, mbNo],0) = mrYes then
begin
OracleSession1.Commit;
end
else
OracleSession1.RollbackToSavepoint('StartImport');
end;

Any ideas on why this error is occurring?
 
This would indicate that somewhere beteen setting the savepoint and rolling back to the savepoint you have committed or rolled back the transaction. If you cannot immediately find this commit or rollback, you can use the Oracle Monitor for help.
 
Beware of any DDL statements like Create Table or something like that. These statements are appended by Oracle with a silent Commit command which removes any pre-defined Savepoint
 
Back
Top