cancel
Showing results for 
Search instead for 
Did you mean: 

JCO timeout handling

Former Member
0 Kudos

hi JCO experts,

I am connecting to a really slow back end system using Jco. Lets say

a) JCO Client.execute takes 5 minutes.

b) I want to run this execution in a seperate thread

Is there a way I can kill the JCO connection itself after 2 minutes? (Imagine something like destroying the connection or closing the socket port)

Kiran

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Kiran,

Use Class <a href="http://www.huihoo.org/openweb/jco_api/com/sap/mw/jco/JCO.PoolManager.html">JCO.PoolManager</a>.

It has get & set methods for ConnectionTimeOut method.

The

Hope it helps.

Regards,

Maheswaran.B

Former Member
0 Kudos

Hi Kiran,

what about using the two methods provided by the com.sap.mw.jco.JCO.Connection class?

disconnect()

public abstract void disconnect()Closes the connection to the remote system.

abort()

public abstract void abort(java.lang.String message)Aborts the connection to the remote system, i.e. tries to send a final message to the host before it disconnects.

Parameters:

message - the final message that will be sent to the remote system.

regards

Dionisios

Former Member
0 Kudos

hi,

Good start.

But disconnectin a connection or aborting the connection is not he goal. It is like specifying a timeout for a method call.

If the timeout exceeds, it shouldnt do anything.

It is similar to JDBC SQLExceptions that are caused because of timeouts ?

Kiran

Former Member
0 Kudos

hi,

there should be default timeout and exception for calls like these, it sounds like something they would build. But I'm not sure if you can set the timeout on it. You could build such an exception handling yourself and try to drill down the system and shut down the connection, but I suppose that's like reiventing the wheel somehow.

regards

Dionisios

Former Member
0 Kudos

Yes there should be. any idea where it is ?

Kiran

Former Member
0 Kudos

Hi,

check this class:

<b>com.sap.mw.jco.JCO.Pool</b>

there seem to be some methods to set timeouts. Maybe you can find something you can use for your purposes.

regards

Dionisios

Former Member
0 Kudos

Hi

I have the same problem as Kiran, and I have tried a few things already. The com.sap.mw.jco.JCO.Pool only support timeout for idle connection, or for waiting for a free connection. I also tried disconnect() and abort() but I get the message:

Exception: Connection cannot be disconnected. Connection currently used in another thread.

I haven't found any solution yet. Does anybody have any ideas?

Regards

Alex

Former Member
0 Kudos

Hi all,

has anybody found a solution yet. I also want to kill/end a connection which is in use after a specified time (esp. 2 minutes).

thanks in advanced

best regards

thorsten

Former Member
0 Kudos

Hi,

Have you tried jco.client.idle_timeout?

OSS 593513