cancel
Showing results for 
Search instead for 
Did you mean: 

Adaptive RFC Model - disconnectIfAlive()

Former Member
0 Kudos

Hi,

In my Web Dynpro application, I am using Adaptive RFC model and executing the RFC as below

***********************

ZRfc_Test_Input input = new ZRfc_Test_Input();

// set input

input.setParam1("xxx");

input.setParam2("xxx");

input.execute();

***********************

My application works fine for couple of days and suddenly I get an error that

"com.sap.tc.webdynpro.modelimpl.dynamicrfc.WDDynamicRFCExecuteException:Could not create JCOClientConnection for logical System: WD_TEST_MODELDATA_DEST - Model: class com.test.TestModel. Please assure that you have configured the RFC connections and/or logical system name properly for this model!"

Our basis guys are unable to figure out why the SLD is misbehaving suddenly. If we restart the SLD, everything will be fine for next couple of days.

I just want to make sure that it is not happening due to my application or due to the way the RFCs are being executed.

After I execute my model, do I have to explicity disconnect the connection using below statement?

<b>input.modelInstance().disconnectIfAlive();</b>

Do I have to do this even when I am using Adaptive RFC model?

Default min and max number of connections are used while creating JCO destinations.

Appreciate your input.

Thanks

Kumar

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member197348
Active Contributor
0 Kudos

Hi Kumar,

It is always better to close the connection after executing the RFC. Coming to your problem, there could be two reasons(may be more but it is working for you two days).

1.SSO ticket expiration: To avoid this configure your JCo login settings

METADATA_DEST userID/pwd (Give the generic user ID/pwd)

MODELDATA_DEST SSO/logon ticket

2.Max. pool size reached

It is better to close the connection if ther are more users <b>modelInstance().disconnectIfAlive();</b>

or you can increase the pool Size:100

Finally, Whenever you get this exception,you can try this option also. Login to Portal and logoff explicitly. Then you can run the application many times it worked for me.

regards,

SIVA

Former Member
0 Kudos

Hi Siva,

>>> It is always better to close the connection after executing the RFC<<<

Thanks for the response. I am sorry for being adamant, I agree that it would be nice to disconnect but IS IT MANDATORY? If the pool size is increased appropriately, doesn't web dynpro runtime takecare and disconnect the connections after the execution.

In SAP tutorials and help.sap.com (at least the ones I have gone through), it is never mentioned any where that one MUST close the connections EXPLICITLY after the execution. All these days I am under the impression that it is not needed for Adaptive RFC models. I may be wrong.

Could you please confirm if we should close the connections explicity?

Thanks

Kumar

former_member182374
Active Contributor
0 Kudos

Hi Kumar,

If you'll close the connections explicitly, you'll lose the pool functionality (a pooled connection is allocated faster than a new connection).

use disconnectIfAlive only if you see that connections are not closed in R3 (due a problem in R3, I saw it on R3 4.6C that was missing a patch).

The Adaptive RFC handles the connection opening/closing for you.

Regards,

Omri

former_member197348
Active Contributor
0 Kudos

Hi Kumar,

It is better not mandatory. If you are using any locking for in your RFC then you <b>must not</b> disconnect JCo as it releases the lock also. But if you are not using such locking from backend you it is better to release the connection. Because it can problems like reaching maximum pool size or SSO ticket expiration.

According to my experience, all the JCo connections for an application are released,

if the application is deployed again, or

if you log off from the Portal explicitly, or

if you select another link(page, workset or role) in the Portal, or

if you restart the application's iView in the Portal.

We too faced few problems for this cause so whenever unlock is called we are releasing the JCo <u>explicitly</u>.

regards,

Siva