Is JCO (SAP java connector) safe?

I could not find the correct documentation about this. There are classes in JCO com.sap.conn.jco.JCoDestination and com.sap.conn.jco.JCoDestinationManager. My questions about them:

  • are they safe?
  • if not, are they expensive to create?
+4
source share
3 answers

I think I finally found it. http://help.sap.com/saphelp_nwpi711/helpdata/en/48/6437ccbdbc51eee10000000a421937/content.htm

ATTENTION In a multi-threaded environment, you must carefully implement the distribution of objects (for example, JCoTable objects) between different threads. Please note that it is not possible to make multiple simultaneous SAP calls for the same direct connection.

Thus, it is not protected by the flow

+2
source

Have you read the connector documentation?

https://websmp105.sap-ag.de/~sapidb/011000358700000730362009D/SAPJCo_Doku_3.0_EN.pdf

I do not understand your question, are you trying to call the RFC and have not reached?

+1
source

This is not to say for the entire JCo infrastructure that it will be thread safe or not. It depends on the classes and instances used.

JCoFunction data container instances, such as JCoFunction , JCoTable , JCoStructure and JCoRecord , are not thread safe - fortunately, because they are usually not available from different streams at the same time, therefore not automatically synchronizing these instances leads to increased performance.

But classes and static methods are thread safe in JCo. For example, you do not need to synchronize calls with the JCoDestinationManager .

And with JCoDestination this is a special case. Usually you do not need to synchronize your calls with this instance, because it will internally create and use different RFC client connection objects for each session. In the default JCo implementation, each thread is treated as a separate session, so you cannot run into thread safety issues here. Only if the infrastructure environment registers its own SessionReferenceProvider during SessionReferenceProvider execution and at the same time assigns the same session identifier to multiple threads, then there can be conflicts with the security threads for RFC calls with state preservation at the same destination. In this case, JCo detects this error situation and throws a JCoException with the error group JCO_ERROR_CONCURRENT_CALL .

+1
source

Source: https://habr.com/ru/post/1380660/


All Articles