cancel
Showing results for 
Search instead for 
Did you mean: 

JCO repository getFunctionTemplate step takes long time - does it cache?

Former Member
0 Kudos

All,

I am using SAP JCO 2.1 to develop an apache tomcat-based java web application. As shown in the JCO tutorial docs, I am using "JCO.Function createFunction(String name)" to get the function template and then get the specific BAPI function. I noticed that a lot of time is taken on the following step:

IFunctionTemplate ft = repository.getFunctionTemplate(name.toUpperCase());

When I try to get the template for BAPI_SALESORDER_GETSTATUS or BAPI_SALESORDER_CHANGE, it takes multiple seconds, and in the case of CHANGE, it sometimes takes 18 seconds. The documentation mentions that "JCO retrieves the metadata only once and caches it to optimize performance". But when I attempt many requests, it still takes a long time.

I am using connection pooling, and my code looks very similar to the tutorial docs. Each time my "get sales order status" code executes from a web page, it gets a client from the pool, calls createFunction, then executes the function, then releases the client.

Any advice on how to set this procedure up so that the getFunctionTemplate step, when ran multiple times, takes a cached definition instead of taking 18 seconds?

Thanks in advance for your replies,

Mark

Accepted Solutions (1)

Accepted Solutions (1)

former_member185029
Active Contributor
0 Kudos

Hi Mark,

this may not be a right forum to post your question.

I would suggest you to try to post in Application Server-> Java Programming forum.

Ashutosh

Answers (0)