cancel
Showing results for 
Search instead for 
Did you mean: 

WDJava JCO connections

srinivas_sistu
Active Contributor
0 Kudos

Hi All,

I have created an application where Iam connectiong to SAPR3 and doing the opperations. Every thing is working fine.

I have created two JCos, namely MyAppsNameJcoModel and MyAppsNameJcoMeta in the ContentAdministration -->WDContent -->Create JCO

Now the problem is If I test the applications through multiple logins simoultaniously, after some time JCO pool is exhausting and I am not able to connect.

Is there any way to release the JCos.

More over please suggest me on:

Is there any process to create a JCO dynamically and use that name while creating the Model.

Please help me...

Regards,

Srinivas

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Srini,

Both lines will do the same work but input_articletype.modelInstance().disconnectIfAlive(); will first check if the instance is active then it will disconnect it.

One suggestion use this line in finally block as if some exception occurs then it will disconnect the JCo and that might be the reason you are getting this error.

Regards

Narendra

srinivas_sistu
Active Contributor
0 Kudos

Hi,

Thanks a lot, Problem solved.

Regards,

Srinivas

Answers (2)

Answers (2)

Former Member
0 Kudos

Check this PDF on JCO programming:

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/8798be90-0201-0010-d093-85f72877...

Blog: /people/tarun.telang2/blog/2005/10/03/debugging-a-rfc-call-using-jco-api-part-2

As mentioned by Narendra, you can disconnect the JCO programatically when needed.

<ModelName>.modelInstance().disconnectIfAlive()

Former Member
0 Kudos

Hi Srini,

Check the JCo Pool Configuration settings of your JCO Destination. This message normally comes when the maximum connections has been reached. Increase the "Maximum Connections" to some number depending on the usage. A good habit is to disconnect the jco connection after executing the same in your webdynpro code if you don't want it to be synchronous.

<ModelName>.modelInstance().disconnectIfAlive()

This will certainly help you

Regards

Narendra

srinivas_sistu
Active Contributor
0 Kudos

Hi,

Thank you for your reply, it is so helpfull. Please clarify me this thing...

Zhr_Rfc_Ess_Integration_Input input_articletype=new Zhr_Rfc_Ess_Integration_Input();

wdContext.nodeZhr_Rfc_Ess_Integration_Input().bind(input_articletype);

try {

my coding....

}

catch(Exception e)

{

wdComponentAPI.getMessageManager().reportSuccess("Exception>>>"+e);

}

finally

{

try

{

input_articletype.modelInstance().getCurrentlyUsedJcoClient().disconnect();

//plese tell me what is the difference between these two...

input_articletype.modelInstance().disconnectIfAlive();

}

catch(Exception e)

{

}

}

Regards,

Srinivas