cancel
Showing results for 
Search instead for 
Did you mean: 

No response/hang while calling JCO.createClient()

Former Member
0 Kudos

Hi there,

I getting this strange occurrence in my production environment. The JCO.createConnection() call will 'hang' without any response from the SAP instance(seperate box). This occurrence is random as there are days where it doesn't happen.

My code sample as follows:

// START OF SAMPLE CODE

String SAP_client = "480";

String SAP_id = "sap_id";

String SAP_language = "EN";

String SAP_hostname = "domain_url";

String SAP_systemnumber = "00";

String SAP_password = "sap_password";

JCO.Clinet mConnection = null;

// My last line of application log stops here. The log after this line of code doesn't appear

mConnection = JCO.createClient(SAP_client,

SAP_id,

SAP_password,

SAP_language,

SAP_hostname,

SAP_systemnumber);

mConnection.connect();

// END OF SAMPLE CODE

Is there some settings I can check on SAP which is preventing the createClient from completing and returning to Java?

Any advise would be appreciated. Many Thanks!

Bernard

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

I understand that the JCO createClient() and connect() will result in a background/system workprocess within SAP.

Is anyone able to advise whats the behaviour of the JCO Libraries when it initiates the createClient() and the background/system workprocess in SAP is 100% ?

Thanks,

Bernard

kishorg
Advisor
Advisor
0 Kudos

Hi Bernard,

might be bcoz of the limited number of connections available with the R/3. better try to use JCO Connection pools instead ofdirect connection..

One major concern when using JCo is simply that of SAP system resources. The SAP application server has a limited number of dialog users that can be allocated for use across the enterprise. Because JCO uses a synchronous RFC call to connect to SAP, it consumes a work process. If these connections are not carefully managed, you could wind up eating up every available work process, depending on the level of traffic your application gets.

Could u connect with this SAP System from SAP GUI?.

just go through these tech artile links...

http://searchsap.techtarget.com/general/0,295582,sid21_gci1095552,00.html

http://searchsap.techtarget.com/ateAnswers/0,289620,sid21_tax289180,00.html

this is one strange problem ..

we have discussed a lot abt JCO . but this is a strange problem...

let me know.

Regards

Kishor Gopinathan

Former Member
0 Kudos

Hi Kishor,

Thanks for your response. I'm also suspecting the number available background work process might be @ 100%.

However, I still do not know the behaviour of the JCO Libraries to come up with a conclusive solution.

I'll be read the links of the tech articles you have posted.

As for JCO connection pooling, I'm considering implementing this, need to find sample codes to deploy to my servers.

As for my application, I only have 1 Java batch job that requires a large data set from SAP, hence, I'm using a direct JCO connection, calling a RFC to retrieve the info I need.

Will update again on my situation, thanks!

Bernard

kishorg
Advisor
Advisor
0 Kudos

Hi Bernad,

After the execution of ur program ,i mean exit from your main program, what will happen in R/3 side is that , the connection created for this particular JCO.Connection will automatically removed from the R/3 server , provided u have not included the connection to your server within an infinite loop or something like that..

so thats not a problem here....

u can do one more thing here.. if u have a background user in R/3 , which have the authorization to execute RFCs then u can use this user here ...(if u need a direct connection)

JCO pool is the better option i think...

<b> how to use a JCO.Pool .. sample code is available with this link..</b>

http://searchsap.techtarget.com/tip/1,289483,sid21_gci886901,00.html

then one more qn ..

through which interface u are doing this ..???..

i ahve already discussed about JCO in these forums .. just refer these also .. some sample codes are also present in these links.

Regards

Kishor Gopinathan