cancel
Showing results for 
Search instead for 
Did you mean: 

JCO Client unable to detect network failure or SAP server reboot

Former Member
0 Kudos

Hi All,

This is my first post to sdn so in case if my post is incorrect category, please help me out.

I figured out that JCO.Client is not able to detect any network failure or Server reboot event and hence lead to error during execute() call. This makes very difficult to control the behavior during runtime.

The two APIs which I used for detecting health of JCO.Client are following:

JCO.Client.isAlive(); //Not able to detect any network failure.

JCO.Client.isValid(); // Not able to detect any network failure.

<b>Can SOMEONE please help me out in controlling this behavior? If you have encountered this issue,please let me know how to handle this issue.</b>

Buisness case is described below:

JCO.Client connects to SAP server for executing a rfc.This client object will be always be looking for request to execute the rfc. After few hours either SAP server reboots or there is network failure for few minutes. JCO.Client is not able to detect this action once the everything is fine and it will give error during execute().

The only possible solution is to call diconnect() and then connect() or only connect(), but it seems that there is no flag available to use connect() automatically.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member182294
Active Contributor
0 Kudos

Two things here:

1) Why you are holding the connection until request comes? Why don't you implement the pool and take the connection from pool whenever request comes for RFC execution.

2) If you are not using pool, you can try following methods to see the status of the connection. You can call getState() method in the connection before calling the RFC, the following are different states of the return JCO.STATE_DISCONNECTED,JCO.STATE_CONNECTED,JCO.STATE_BUSY ,JCO.STATE_USED. If still it doesnt work you can call ping() method which will through an error if the server is down. But this is not useful if the netwokr connection is restored or server reboot happend. getState() should work.

Former Member
0 Kudos

Thanks for reply. But even getState() is not able to detect any broken network connection. Its shows the same status in all conditions. Sometime it gives getState()=18 (??) and sometimes it gives 2 (Connected) as result.

The frequency of request is high and hence it is required to keep it connected.

Do we have some other methods to achieve the same?