cancel
Showing results for 
Search instead for 
Did you mean: 

JCO.Server and multithreading

Former Member
0 Kudos

Hi All,

I have a question about how you build a JCO.Server that could accept multiple concurrent requests...

In the application we are building, the number of requests is likely to be very high and having a JCO.Server that can only accept one call at a time is likely to adversley affect performance.

I can see two ways that you may be able to fix this:

1. Build threading into the handleRequest method - I get the impression from the documentation that this won't work as it indicates that as soon as the handleRequest method completes it returns the results back to SAP.

2. We don't need to do anything - multiple concurrent requests are handled by JCO itself. I can't find any kind of documentation that supports this.

3. We register different instances of the same server against the gateway. This seems the more likely way it wants you to work, however this means there is no way to dynamically scale the application as load increases.

From looking at the underlying C RFC library documentation, it says it fully supports multithreading - so it seems a bit odd that this isn't also covered in the JCO library.

Anyone have any advice on how you can implement what we need with the JCO libraries?

Accepted Solutions (0)

Answers (2)

Answers (2)

SidBhattacharya
Product and Topic Expert
Product and Topic Expert
0 Kudos

Smith,

Look into 'JCO RFC Provider Service' which helps you acheive this via a Stateless EJB. This way you don't have worry about scalability.

Regards

Sid

Former Member
0 Kudos

Hi Lee,

in our application we start 3 instances of jco.server and each is registered at the sap gateway. It works good for us. In your case it is very unlikly that there are more than 3 requests at the same time but we could increase the number.

hth

Torsten

Former Member
0 Kudos

Hi,

may I have a sample of starting multiple instances of JCO Server in order to handle multiple requests ?

Thanks

Former Member
0 Kudos

create a class 'exampleServer' externed JCO.Server.

//in your main method,create a array of JCO.Server by:

exampleServer serverConnections[] = new exampleServer( i );

//than start your JCO.Server

serverConnections[] .start();

the array length i decide how many server do you create.

Edited by: steiner fisher on May 30, 2008 7:23 AM

Edited by: steiner fisher on May 30, 2008 7:23 AM

Edited by: steiner fisher on May 30, 2008 7:24 AM