Hello,
in many places of our code we have selects that call a function in a package.
when we recompile the package the users get a error message of the type
ORA-04068: existing state of packages has been discarded
ORA-04061: existing state of package "XXX.TEST_PKG"
has been invalidated
ORA-04065: not executed, altered or
dropped package "XXX.TEST_PKG"
My solution is to put the assignmend of the Sql statment, the variables, the prepare and the activate in a loop with a try except, check if the error Message contains ORA-04068 and repeat the loop one time. On the error oracle resets the package status and the next loop it works.
It is a lot of work to do this in all the places where this pacakge function is called.
Is there a way to tell ODAC to retry himself one time if this error occurs ?
This would be a very nice feature
Thanks
Andreas
Thanks
Andreas
Handle ORA-04068 invalidated package
Re: Handle ORA-04068 invalidated package
Hello,
To handle all the errors (that occur in all the ODAC components), you can use the onError event, in which you can check the error code and ignore this error.
To handle all the errors (that occur in all the ODAC components), you can use the onError event, in which you can check the error code and ignore this error.
Code: Select all
procedure TForm1.OraSession1Error(Sender: TObject; E: EDAError;
var Fail: Boolean);
begin
case E.ErrorCode of
4061, 4065, 4068: Fail := False;
else Fail := True;
end;
end;