Tuesday, May 06, 2014

ORA-04068: existing state of packages has been discarded ORA-04061: existing state of package body "custompkg" has been invalidated ORA-04065: not executed, altered or dropped package body "custompkg" ORA-06508: PL/SQL: could not find program unit being called: "custompkg"

Issue

You have a soa process which is trying to call a procedure created in a database different than your dehydration store.
You have recompiled your procedure and the first soa instance after that is failing with the below error.

Exception occurred when binding was invoked. Exception occurred during invocation of JCA binding: "JCA Binding execute of Reference operation 'token' failed due to: Stored procedure invocation error. Error while trying to prepare and execute the custompkg.token API. An error occurred while preparing and executing the custompkg.token API. Cause: java.sql.SQLException: ORA-04068: existing state of packages has been discarded ORA-04061: existing state of package body "custompkg" has been invalidated ORA-04065: not executed, altered or dropped package body "custompkg" ORA-06508: PL/SQL: could not find program unit being called: "custompkg" ORA-06512: at line 1 Check to ensure that the API is defined in the database and that the parameters match the signature of the API. This exception is considered not retriable, likely due to a modelling mistake. To classify it as retriable instead add property nonRetriableErrorCodes with value "-4068" to your deployment descriptor (i.e. weblogic-ra.xml). To auto retry a retriable fault set these composite.xml properties for this invoke: jca.retry.interval, jca.retry.count, and jca.retry.backoff. All properties are integers. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution.

Reason

This is a know issue as the data source keeps the cache statement in the server hence the first connection fails as it is still pointing to the previous connection.

Resolution

There are two ways to resolve this issue

1> Just update your db adapter by going through the wizard once again(already created) and redeploy the process again to soa server.

2> Clear the cache statement of your data source

Go to your admin console

http://host:port/console

Go to Services -->Data Sources

Select your data source and go to control tab

Select the soa server and click on Clearn statement cache




Then



Once cache is cleared just reset the connection.

No comments: