on 07-15-2005 3:55 PM
Hi,
I'm calling two update RFC one after another in a single WebDynpro program. I like to close the session/connection after calling the first RFC. I'm using twp separate JCo connection for calling these two RFCs. Still I find both the RFCs are called in the same session.
Is there any way to close the JCo session from the code?
Thanks ,
Dipankar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dipankar
If you want the framework to control the opening and closing of the connections , then use TASK_SCOPE when initializing the modelobjects ,in which case the connection will remain open, for the lifecycle of a single call.
The intialization should be as below
(CompanyCodeList is your model object)
CompanyCodeList compCode = (CompanyCodeList)WDModelFactory.getModelInstance(CompanyCodeList.class, WDModelScopeType.TASK_SCOPE);
Bapi_Companycode_Getlist_Input bapIn = (Bapi_Companycode_Getlist_Input) compCode.createModelObject(Bapi_Companycode_Getlist_Input.class);
wdContext.nodeBapi_Companycode_Getlist_Input().bind(new Bapi_Companycode_Getlist_Input());
Regards
Pran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Pran,
Using TASK_SCOPE force model object to be disconnected from model (and garbage collected later) right after request/response phase is ended. Therefor <b>you must not add such objects to context nodes</b>!!!
Valery Silaev
EPAM Systems
Hi Dipankar
1.Get the instance of the Model object
2. Get the JCO connection
3. Close the connection
Ex:
<Model Name> obj = (<Model Name>)wdContext.currentBapi_XXX_InputElement().model();
JCo.Client jcoclient = obj.getJCoClient();
Regards
NagaKishore
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jaydeep,
I am having problem in closing the JCO connection. When I used your code it throws below exception.
The type of model represented by class 'com.rak.model.Ztest_Function_Input' is not compatible for creation by WDModelFactory!
Your help appreciated.
Note: I am using content admin for JCO connection.
Regards,
Rakesh.
Hi NagaKishore,
I am having problem in closing the JCO connection. When I used your code it throws below exception <b>not compatible for creation by WDModelFactory!</b>.
The type of model represented by class 'com.rak.model.Ztest_Function_Input' is not compatible for creation by WDModelFactory!
Your help appreciated.
Note: I am using content admin for JCO connection.
Regards,
Rakesh.
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.