cancel
Showing results for 
Search instead for 
Did you mean: 

Jco reconnect to SAP

Former Member
0 Kudos

Hi All,

is it possible to monitor if a Jco.Server instance is still connected to the SAP-System? I tried isAlive and isValid but non worked. To test I just disconnected the machine on which Jco is running from the network. The result was that Jco.Server.isAlive and .isValid still returned true. I need this functionality because some SAP-Systems are sometimes not available and I want Jco to reconnect when the system is available again.

Any help appreciated

Torsten

Accepted Solutions (0)

Answers (1)

Answers (1)

Erin2
Advisor
Advisor
0 Kudos

Jco.Server is a class for hosing your own jco server. That is, the jco.server class can be used to create a server which will respond to calls from external systems via rfc. Jco.Server is only used if the SAP system is initiating the call. If your java application is initiating the call to SAP, then you should be using the jco.client class jco.client.isAlive() will tell you if the connection to the backend SAP system is still there.

Cheers,

Erin

Former Member
0 Kudos

Hi Erin,

thanks for your reply. I use Jco the way you described it. The Server waits for requests from SAP. The problem is that the Server is sometimes (e.g. because of network problems) not connected to the SAP-System. When such an error occued the jco.server is no longer available for the sap system and I have to reconnect it manually. I want the Jco.Server to check itself and if neccessary reconnect. But I can't find a way to check if the server is still connected.

Torsten

Former Member
0 Kudos

You have to have your server implement the status interface... and check that the returned server in the status is itself....

Then you have to have a displayStatus function that allows you to query this status... and possibly fire off some action on statuschange or if the status is disconnected....

As a rule the JCO server will reconnect on its own...

The reconnection intervals are something like (check out your JCO error trace log devrfc.trc or *.trc)

1 min for the first 5 min

2 min for 5 min

5 min for 20 min

10 min for 20 min

20 min

40 min

every hour...

So yes in between your server is down...

If immediate action is required have your server fire an email (javamail) or page when the status changes to disconnected...

Former Member
0 Kudos

Hi

I already implemented this iterface. I am a little confused because the server dos not change the status if it is not connected to the server. I remove the network connection but nothing changed. The status was still JCO.STATE_STARTED. Is it just my Jco.Server instance that reacts like that or can anybody confirm this behaviour?

thanks

Torsten

Former Member
0 Kudos

Torsten,

You have to push the status once you receive it.

If you are looking at a swing class you have to implement event notification on status change, otherwise your text in the textbox will always remain the same...

Message was edited by: F.J. Brandelik

If you are looking for a snippet of code email me at

fjb_saper at msn dot com