cancel
Showing results for 
Search instead for 
Did you mean: 

Timeout for the execute call on Client in JCO

Former Member
0 Kudos

We are using the JCO 2.1.6 on Linux. We want to have a timeout option on the Client execute API call. We are invoking RFC's using the execute call and sometime if there is a network/Connection problem to SAP Server the execute call never return. We want to timeout this call. We are invoking the execute in synchronous mode.

I will appreciate if someone can let me know the solution of how to end/timeout the execute call.

Thanks in advance

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks Abhilash,

Let me try it out and see how things go.

Former Member
0 Kudos

Thanks for the answer. I already tried that and it dosen't work. I think the PoolManager setConnectionTimeout is for timeout for making connection but once connection is established this doesn't play any role.

I want the execute call to get time out.

former_member182294
Active Contributor
0 Kudos

Hi,

<b>Connection is treated as timed-out when there is no activity on it for the specified time interval. setConnectionTimeout is used for this purpose</b>

For making connection setMaxWaitTime method is used.

You can try one more thing, write a thread which periodically checks the connection if it is alive using <b>isAlive()</b> method. Because of network problem or any other problem if connection is lost then this method returns false, so you can release connection. Even if isAlive doesnt help you, set your Thread to sleep for the time you want to wait for the response after that release connection.

Regards

Abhilash

Regards

Abhilash

former_member182294
Active Contributor
0 Kudos

Hi Manoj,

If you are using connection pooling for JCO, you can use the following methods to control time out connections. These methods are part of <b>JCO.PoolManager</b>

setConnectionTimeout(long connection_timeout)

setTimeoutCheckPeriod(long timeout_check_period)

For more details check the JCO API.

Hope this will solve your problem.

Regards

Abhilash