cancel
Showing results for 
Search instead for 
Did you mean: 

SAP JCo performance

Former Member
0 Kudos

Hi there,

I have written a standalone Java application using SAP JCo library to communicate to SAP System. The application is used to manage SAP accounts, etc.

I use JCO.createClient() to get direct connections (JCO.Client object) to the SAP system. I don't use JCo's connection pool, I have my own connection pool management code. I get my connection from my own pool and after I finishes with the connection, I call reset() on the connection before I return it to the pool.

When there are multiple threads trying to do the same thing on the SAP system, like calling BAPI_USER_CREATE1 with execute() method on the JCO.Client object, the performance could be so poor that the call to execute() could take close to 2 minutes to return. And sometimes the call to reset() could also take more than 1 minute to return.

I have tried to use JCo's connection pool and I got the same result.

Could someone help out here please?

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello

try to increase the heap (memory) size of your program (Xms and Xmx parameters) and do not use the same JCO.Client, JCO.Connection, JCO.Function in multiple threads, because AFAIK JCO is not thread safe

regards franz

reward points if useful

Former Member
0 Kudos

Hi,

Do you have execute after the BAPI : BAPI_TRANSACTION_COMMIT ?

You should read an interesting article :

[Tips & Tricks JCO Programming|http://www.winfobase.de/lehre/lv_materialien.nsf/intern01/FB09D79A41930E34C125709F0046180C/$FILE/Tips&Tricks_JCo_Programming.pdf]

Don't forget to release the JCO.Function and clear the JCO.Table

I think the problem come from the multi-threading. Try with one thread and a loop to call many times BAPI_USER_CREATE1 and BAPI_TRANSACTION_COMMIT!

Multi-threading use a lot of ressources!

I'm hoping it will help you.

Best regards,

Mathieu