Skip to Content
Former Member
Apr 08, 2009 at 04:15 PM

SAP JCo 3.0 - too many network connections


I have implemented a standalone JCo-Client which has to make multiple calls to the same BAPI.

Java 1.5

SAP JCo 3.01

Windows Server 2003

Now I have the problem that each BAPI-Call opens a new network connection (checked with netstat). I use a pooled connection, I have only one JCoDestination object and one JCoFunction object on which I do many function.execute(destination).

Under JCO 2 i used a ClientPool and didn't have the increasing number of network connections.

Any ideas how to solve this.

I add the rump coding so you get the idea:

String destinationName = "ConnPool";

Properties connectProperties = new Properties();
connectProperties.setProperty(DestinationDataProvider.JCO_ASHOST, "XXX");
connectProperties.setProperty(DestinationDataProvider.JCO_POOL_CAPACITY, "5");
connectProperties.setProperty(DestinationDataProvider.JCO_PEAK_LIMIT,   "5");
createDestinationDataFile(destinationName, connectProperties);

int count = 0;

try {
    JCoDestination destination = JCoDestinationManager.getDestination(destinationName);
    JCoFunction function = destination.getRepository().getFunction("BAPI_NAME");
    if (function == null)
        throw new RuntimeException("BAPI not found in SAP.");

    do {
        try {
            JCoStructure importStruktur = function.getImportParameterList().getStructure("IMPORT");
            JCoStructure exportStruktur = function.getExportParameterList().getStructure("EXPORT");
        catch (AbapException e) {
    } while (count < 50000);

catch(JCoException ex) {

Edited by: Jochen Lang on Apr 29, 2009 1:30 PM