Entering content frame

Function documentation Shared JCO Repository Locate the document in its SAP Library structure

Available since Enterprise Portal 6.0.2.3

 

The JCO client service provides shared JCO repositories. This feature should be used by applications that frequently use JCO repositories. The JCO client service maintains a list of repositories and subsequent requests from one user to a specific destination. Therefore an application does not need to create or stored these repositories.

The shared JCO repository is implemented as a repository that has no JCO client assigned. It is just acting as a cache. When a specific user calls the getRepository() method, a JCO connection is established using his user credentials. When the information requested by this is not in the cache, this connection is used to fill the cache of the shared JCO repository. From now on, the information is available to all users of the shared JCO repository.

Example: Obtaining a repository from the repository cache

public class JCOComponent extends AbstractPortalComponent 

  public void doContent (IPortalComponentRequest request, IPortalComponentResponse response) 
  { 
    String myDestination = "Internal_System_3"; 
    IJCOClientService clientService = (IJCOClientService)request.getService(IJCOClientService.KEY); 
    JCO.Repository = clientService.getRepository (myDestination, request); 
          try 
          { 
                //use the repository 
          } 
                catch (JCO.Exception e) 
          { 
      // check the exception if the repository can be further used; 
      // if there is a problem in the repository, delete it 
                clientService.deteteRepository(myDestination, request); 
    } 
  } 
}

The IJCOClientService.getRepository() API is compatible to previous versions with one difference. In previous versions the method returned different repositories per Portal user; now the method returns the same repository for all Portal users.

Repository Cache Invalidation

When the shared JCO repository cache becomes invalid, for example, when changes are made to the module parameters of a function module, you can invalidate the cache. The Portal application com.sap.portal.runtime.application.jcoclient provides the service clearRepositoryCacheService. This service clears the cache of one or several repositories. It has following properties:

Repositories

The name of a repository corresponds to a system landscape alias. The property can contain several repositories separated by semicolons.

Example

Repositories="FI_5; HR_1"

Every time the JCO client service is started or restarted, it clears the repositories listed in the property Repositories. To clear the repository periodically, you have to set the Interval property.

Interval

The timer is initialized every time the service is started or restarted. All repositories specified with property Repositories are cleared periodically at this interval.

The value is specified in milliseconds. The value must not be less than 300000 milliseconds (5 minutes).

Leaving content frame