Show TOC Start of Content Area

Background documentation JCo Client Service  Locate the document in its SAP Library structure

Portal applications that use the JCo-API can create unexpected spikes in the memory consumption. Especially the method JCO.createRepository() creates a lot of temporary objects causing increased garbage collection overhead and even OutOfMemory exceptions when used carelessly. To minimize the usage of this expensive operation, the caching-facilities introduced with the latest JCo Client-Service should be used.

Recommendation

JCo is deprecated.

Please note that JCo has been replaced by the SAP Connector Framework (based on JCA) as of EP 6.0. It is only included for compatibility reasons. For new developments Connector Frame/JCA must be used.

The call of method JCO.createRepository(0) should be replaced by the method  IJCOClientService.getRepository().

Example of a not recommended implementation:

   String sysId = myProfile.getProperty("SystemIdentifier");
   IJCOClientService clientService = (IJCOClientService) 
     PortalRuntime.getRuntimeResources.getService(IJCOClientService.KEY);
   IJCOClientPoolEntry jcoPoolEntry = 
     clientService.getJCOClientPoolEntry(sysId, componentRequest);
   …
   JCO.Client client = jcoPoolEntry.getJCOClient();
   IRepository repos = client.createRepository(
"mydestination", client);
   …
   client.execute(…);
   

   jcoPoolEntry.release();

 

Example of recommended implementation:

   String sysId = myProfile.getProperty("SystemIdentifier");
   IJCOClientService clientService = (IJCOClientService) 
     PortalRuntime.getRuntimeResources.getService(IJCOClientService.KEY);
   IJCOClientPoolEntry jcoPoolEntry = 
     clientService.getJCOClientPoolEntry(sysId, componentRequest);
   …
   JCO.Client client = jcoPoolEntry.getJCOClient();
   IRepository repos = clientService.getRepository(
"mydestination",
     componentRequest);
   …
   client.execute(…);
   …
   jcoPoolEntry.release();

 

More details about SAP JCo can be found on the SAP Help Portal at:

SAP Library SAP NetWeaver by Key Capability Application Platform by Key Capability Connectivity Components of SAP Communication Technology Communication Between ABAP and Non-ABAP Technologies SAP Java Connector

 

End of Content Area