Error:-
The changes were not applied because ORA-04061: existing state of has been invalidated ORA-04061: existing state of package body "APPS.HR_PERSON_ABSENCE_SWI" has been invalidated ORA-04065: not executed, altered or dropped package body "APPS.HR_PERSON_ABSENCE_SWI" ORA-06508: PL/SQL: could not find program unit being called: "APPS.HR_PERSON_ABSENCE_SWI"
Issue:-
The leave request approval works fine from the notification list but not from within the email and gives an error that the package is invalid.
For absence approval for HRSSA , after approval the workflow ends with this error for all transactions.
Solution:-
The Workflow Mailer is known to error out with this error too.
This is how the database process in memory behaves when an object is recompiled.
The notification mailer is a perpetual process. Whenever any changes are made to the underlying code for generating the PL/SQL document, then the wfmail or WFMAIL process will be using an invalid version of the code.
When an object is recompiled, the objects referencing it, and which are already uploaded in memory, fail with this error. This does not only happen with the Workflow Mailer. It happens with any object already allocated in the SGA referencing an object that is being compiled.
This error is expected and is not solely related to the Workflow Mailer. What happens is that the Workflow Mailer objects are pinned in memory and they become invalid when the objects they refer to are recompiled.
Every time one of the referenced objects is recompiled, other objects in memory will need to be relocated in memory by restarting the corresponding process - the mailer in this case.
Different options can be tried:
1. Just retry the failing operation, this way the database recompilation can validate the object and stop the error.
2. Bounce the Mailer.
3. A last resource would entail to bounce the database.