Monday 13 November 2017

SOA 12c DBAdapter : JCA Binding execute of Reference operation 'insert' failed Caused by java.sql.SQLException: Attempt to set connection harvestable to false but the connection is already closed.

Recently when trying to test a DBAdapter service I came across this issue. You can follow the same steps as I did to resolve the problem.

Error:
com.oracle.bpel.client.BPELFault: faultName:
{{http://schemas.oracle.com/bpel/extension}remoteFault} messageType:
{{http://schemas.oracle.com/bpel/extension}RuntimeFaultMessage} parts: {{ summary=Exception occurred when binding was invoked.
 Exception occurred during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to:
 DBWriteInteractionSpec Execute Failed Exception. insert failed. Descriptor name: [EmpTemp.Emp_Temp]
Caused by java.sql.SQLException: Attempt to set connection harvestable to false but the connection is already closed.

Actual Reason:
DS that you are using is stale.
Means, lately the DBMS that you are connecting to, was restarted or refreshed and WebLogic Server lost the connection to it.

Why this happened?
You have not yet configured the pool to test connections, so once the connection is dead,
WLS still knows nothing about that, and will save and serve up dead connections until the pool is rebuilt.

Do one or both of the below things:

Solution: Enable test-connection-on-reserve (so that is does not happen again).
Or
Implement Work-around: Reset the datasource from the console after the DBMS is back up.

When you reset the database connections in a JDBC data source, WebLogic Server closes and recreates all available database connections in the pool of connections in the data source.

To reset database connections in a JDBC data source:

1. Navigate to the data source that you want to reset:
2. Select the Control tab.
3. On the Control page, select the instances of the data source that you want to reset.
    Date source instances are listed by the server on which they are deployed.
4. Click the Reset button.
5. Click Yes to confirm the action.

     Results are displayed at the top of the page, and the Status of Last Action is changed to SUCCESS for each data source that you selected to reset.


Helpful? Please Comment.

Happy Learning!!


No comments:

Post a Comment

OSB 12c : Dynamic Routing to Business/Proxy Service

Dynamic routing is a kind of  Content-based Routing pattern, which is used when the BusinessService/ProxyService path is required to be de...