cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with JCO destination/connection pooliing - webdynpro adaptive RFC

yasu_ramaiah
Explorer
0 Kudos

Hello!!!

I ve created a web dynpro application which uses adaptive rfcs. The application works fine with out any problem(i.e. the jco destinations are configured fine using content admin of Webdynpro). The probelm occurs when I open ten sessions(i.e. run the same application in 10 diff windows). The problem - the adaptive RFC stops working once 10 sessions are opened. The number 10 specifies the maximum JCO connection the JCO destination pool is configured to.

My question is if you consider a database datasource configured on WEBAS the datasource is nothing but a pool of database connections. So isnt the JCO destination same as JCO connection pooling. If the JCO destination is same as JCO connection pooling why is it that once the 10 sessions are opened the JCO connections are runnning out (to be clear, once I say adaptiverfcmodel.execute() should I close the JCO connections myself or should the JCO connections close automaticaly)

Let me know if I am doing anything wrong. Also can any one suggest how many connection should the destination should have if the application has to go live.

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Yasu,

From SAP Help,

Maximum Pool Size - Specifies the maximum number of open connections stored in the pool. They can be immediately used by the application.

Maximum Connections - Specifies the maximum number of connections available in the pool. They can be generated at runtime. If all connections are used and the capacity of the pool is exhausted, the next requested connection is sent to a queue until another connection is closed. The duration of the waiting time in the queue is specifed by the option Maximum Waiting Time. If no connection is closed during this waiting time, an error message appears.If the number of Maximum Connections is higher than the number of Maximum Pool Size, the JCo connections that are not needed are immediately closed.

Check the following pages to understand the Connection Pool and the JCO Connections in the Content Admin.

http://help.sap.com/saphelp_nw04/helpdata/en/77/931440a1c32402e10000000a1550b0/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/35/42e13d82fcfb34e10000000a114084/frameset.htm

So if you want to open more connections, give a higher value for the Maximum Connection. However, you should give lower value for Maximum Pool. This will ensure that whenever a connection is not used, it will be automatically closed. Also keeping the maximum pool to a lower value avoids consuming too many SAP system resources.

Hope this is helpful.

Regards,

Shubham

yasu_ramaiah
Explorer
0 Kudos

Hello Shubham,

Thank you for your time and sorry for a delayed response. I understand that by increasing the max connections will solve the problem, but thats not what I am looking for. I was expecting that as soon as the execute method of the (model) adaptive RFC is called, the underlying JCO connection will be closed, but it not working that way.

Say at any instance 10000 users(i am just making up that number) are using the webdynpro application which makes use of adaptive RFC, in this case setting max jco connections to 10000 is not reasonable right!!!.

For sure keeping 10000 connections is no good because not all 10000 users use the adaptive rfc continously for the entire session.

Thank,

Yasu

Former Member
0 Kudos

Hi yasu

You have two ways to acheive this either you can kill the connection as soon as the call has completed , this is done by initialising the Model object with TASK_SCOPE, if no scope resolution has been provided APPLICATION_SCOPE is taken by default.

The other option is to close the connection as soon as the browser is closed , this is more efficient because for sequential calls with in a page the same connection can be reused , this is acheived by setting the connection timeout to 0 in the same section where you define your other parameters

TheModel modeObj = WDModelFactory.getModelInstance(TheModel.class,
WDModelScopeType.TASK_SCOPE);
Bapi_Get_Flight_List_Input bapiIn =(Bapi_Get_Flight_List_Input)
modeObj.createModelObject(Bapi_Get_Flight_List_Input);
wdContext.nodeBapi_Get_Flight_List_Input().bind(bapiIn);

Regards

Pran

Message was edited by: Pran Bhas

yasu_ramaiah
Explorer
0 Kudos

Hello Pran,

Thanks for the valuable information, its very good to know the tips and tricks. Sorry for the delayed response. I havent tried your technique yet, so i shall update thi thread once I do so.

-yasu

Former Member
0 Kudos

Hi Pran,

I have written the code to kill the RFC connection as soon as the call is completed.

But on deploying my application i'm getting the following error :

com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: failed to create or init instance of model 'associatemaster.Zcptms_Access_Assmas_Input' in scope APPLICATION_SCOPE with instanceId 'null'

I tried changing the scope but am getting the same error.

Kindly give inputs.

Regards,

Lisha

0 Kudos

Yasu...have you been able to successfully use the info provided by Pran...any help is appreciated

Thanks