cancel
Showing results for 
Search instead for 
Did you mean: 

Multithreaded Server Architecture with JCo for Outbound Calls?

UweHaehle
Discoverer
0 Kudos

Hi together,

i wrote a small server which connects our R/3 (4.6C) with a BS2000 Mainframe. I used SAPJCo 2.1.3. The application works fine but i don't feel comfortable with creating a fixed number of server threads for handling multiple outbound calls. I am not keen on writing own load balancing routines.

Does anybody know if it is possible to program a JCo server that dynamically starts new threads for serving calls from the R/3 system?

Regards & Thanks for reply,

Uwe

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

This is not possible from the API as far as I know.

A possible workaround if you expect a really high load of requests or long running function calls would be to start a new server thread each time a function call is requested and to stop that server thread when the original function call returns. In other words each server thread generates a child thread upon being called from R/3 and sends a stop request to the child when the call is returning. All you need is to add synchronized stop() and isStopped() methods to the server thread class. The stop() method of JCO.Server should be overridden such that it can stop only if no function call is handled.

Regards

Richard

UweHaehle
Discoverer
0 Kudos

Hello Richard,

thank you for this explanation. Starting child threads during function call handling is a really smart and simple solution.

Regards,

Uwe