cancel
Showing results for 
Search instead for 
Did you mean: 

Possibilities to Handle Server Connection Problems

Former Member
0 Kudos

Hey there,

I wrote a little Server Program with the SAP .NET Connector. And it works fine, but what happens, if a Network Problem or something else occurs? Does I have opportunities to Hanlde such Problems with the Connection within my C# Program? The SAPServer Class has only an Event Disposed. What can I do, when my Server runs and for example the Network gets down?

And another thing I want to know, is the SAPServerStatus. I tried to Pause it and Continue. And this works also fine. But when I Output the ServerStatus, it shows also after continuing the Status: PausePending. Does I have to implement a little Wait routine, which waits until the Server is really Paused?

Thanks for all answers.

Regards,

O.Rill

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

I am having the same problem, i use

ActionOnServerException.Reconnect;

and it does nothing at all. It doesnt try to reconnect, nothing happens.

Former Member
0 Kudos

Does nobody has an answer to my question?

Please tell me, if the SAP .NET Connector has any functions for a SAP Server to Handle Connection Problems...

reiner_hille-doering
Active Contributor
0 Kudos

Create your own ServerHost class (inheriting from the original one)and override the OnServerException method. The orignal version of this method will terminate the server ("return ActionOnServerException.Terminate"). Instead you can just continue ("return ActionOnServerException.Reconnect" or "return ActionOnServerException.AutoReconnect") or anything you think is appropriate. Note that every exceptions here will cause a entry in the trace and log files, so don't be irritated if they get very long over time...

Former Member
0 Kudos

This is, what I allready tried. But if I Start the Server with a wrong Host adress, the Method is not called. Here is my Code for the Method:

public class ServerHost : SAP.Connector.SAPServerHost

{

public SAP.Connector.ActionOnServerException onServerException(SAP.Connector.SAPServer server , System.Exception e)

{

Console.WriteLine("A Server Exception was thrown"+e);

return SAP.Connector.ActionOnServerException.AutoReconnect;

}

}

Former Member
0 Kudos

Ok, I found the Problem.

But I don't understand what the ActionOnServerException does? I chose the Reconnect Value. But It does nothing...

Former Member
0 Kudos

Is there no Chance to get an Changed Event on the Server Status?? This would be a good one for all Server Developers, I think.

The ActionOnServerException is not enough I think.... For Example the AutoReconnect is doing nothing. And the normal reconnect is also not very good, because it trys and trys. It would be much better to wait a little and then try again.

Former Member
0 Kudos

Ok, Now I understand, why you sometimes don't want to answer. I got an email from my Prof. which has contact to a college within SAP.

But you could also say this to me. Anyway thanks for your Help and your Time!!!!

Best Regards,

Oliver