cancel
Showing results for 
Search instead for 
Did you mean: 

JCo Connectivity

Former Member
0 Kudos

I have a "behind the curtain" questions about the JCo connection. Some things are surprising for me. It did some R&D with Packetyzer (Network Analysis).

a) When I add a connection to a pool, this takes some time (220ms), but I do not see any packets sent.

JCO.addClientPool(SID, 10, PoolPerformance.login_params);

//key of the pool / max.connections -> no network connectivity, but takes about 200ms

b) If I create another client now, this takes almost no time. Client client = JCO.createClient(....)

If I do not do the JCO.addClientPool before, it takes about 200ms

=> Conclusion:

Somehow the first Client created initializes some kind of structure, not sending data yet. Guess it does some network binding.

c) The first network traffic is visible when I create the function template IFunctionTemplate ftemplate = repository.getFunctionTemplate("RFC_SYSTEM_INFO");

Questions:

========

1) Is it, that the logon to SAP takes place in the moment when the client is first used (in my case at c)?

2) Considering my observations, what is the use of pools anyway? Because a pool is - unlike in JDBC - not a bunch of existing established connections (because I do not see any network data in a). What is your experience with this?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Timed out, close as cleanup

Former Member
0 Kudos

in my option the 200ms are the time jco requires to load the rfc libraries (dll´s on windows), but i´m not quite sure about this

answer 1: looks like if the connection to sap takes places the first time a client is needed, but there will still be pooling, because if you get a connection through a pool JCO.getClient(POOL_NAME) and then release it back through JCO.releasClient (client) the connection won´t be closed (until the timeout has been reached), so the next time a connection is opened through the pool there is no need to do a logon for this connection any more.

answer 2: there is a use for connection-pooling

there will be bunch of existing connection, but it looks jco starts to open connections only if they are needed, and there are no open connections inside the pool. So for connections over a period of time the logon procedure will only be done once.

Another use of pooling is the possibility to limit the number of concurrent connections -> useful to avoid performance problems in your backend sap system.

have a look at the documenting (pdf) shipping with jco for more detailed information

regards

franz

Former Member
0 Kudos

Hi Franz,

thanks for your answer.

For 1) I agree, it is most likely the initialization of the JCo library dll which takes the time.

For 2) The thing with the pool is clear in general, what confused me is the fact, that opening the JCO connection does not really mean opening the connection physically at this moment. As we both have figured out, this (most likely) happens when the Function Template is first used. I have crosschecked this, obtaining the second function template is much faster than getting the first (obviously the logon procedure is not required here anymore).

The Tutorials cover some of this, but not going deeper (quite understandable).