Handle ORA-04068 invalidated package
Posted: Wed 11 Feb 2015 14:47
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
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