Sunday, February 5, 2012

Error in Workflow ORA-04061: existing state of has been invalidated

Working with workflows can be tough when you get errors that are really difficult to debug. As I was recently working on one of the custom workflow, I encountered the below error


"Error in Workflow /203462 ORA-04061: existing state of has been invalidated"

First thing I did was to check if the Package that has been called through workflow was in valid state and to my surprise it was. After a lot of research I came to know that this is a bug in Workflow.

Cause:
If you are designing/modifying a workflow process, the workflow works fine for certain instances and you modify the Package and recompile it. And now you run the workflow process you get the above error. Recompilation of package spec/body called through workflow is the main reason you will end up with this error.
This happens as workflow fails to look at the new status of the package after compilation and it continues to look at the old SGA data.

Solution:
1. One simple way to get away with this error without involving DBA/Sysadmin team is to rename the package that is being called through the workflow and accordingly modify the workflow to call the new package. And repeat this every time you need to recompile the Package.



2. This solution works if you don't have option of bounce
          KILL ACTIVE/ERROR SESSIONS OF WORKFLOW

         DROP INVALID PACKAGE(Package for which your getting the error)

         RECOMPILE DROPPED PACKAGE

         FORCE RELOAD YOUR WORKFLOW IN DATABASE
3. Another trick that might work out is to cancel all the Active/Error instances of this Workflow by using the System Administrator>Workflow : Administrator Workflow>Status Monitor.
4. Depending upon your access to the Instance(Workflow Manager) you need to restart the Notification mailer and Service components. If this doesn't work out then you go for 4.
5. Get your DBA/Sysadmin to bounce the instance.

3 comments:

Unknown said...

Thanks for this information

Unknown said...

Hi,

Thanks for this useful information.

Shanthi Cabs said...

Amazing article. Your blog helped me to improve myself in many ways thanks for sharing this kind of wonderful informative blogs in live. I have bookmarked more article from this website. Such a nice blog you are providing ! Kindly Visit Us @ Madurai Travels ! Best Travels in Madurai | Tours and Travels in Madurai