on 03-30-2007 5:24 PM
Dear All
I have a scenario. In that I am using 4 Views. And I have 3 separate models. I want to close the Connection explicitly when I go back from 4th View to 1st View.
The control flow is like this
V1-->V2-->V3->V4---V1. and it continues.
How can I acheive this? I want to close all the Connections before going again to 1st View.
The user may exit from any View. At that time also I want to Close.
Where should I write the close connection coding?
<ModelName> search=(<ModelName>)WDModelFactory.getModelInstance(<ModelName>.class);
search.disconnectIfAlive();
Can anybody help me in this?
Regards
Aparnna
Hi,
Execute your FNmodule u need to mention the try catch() method.
Simply mention the Connection close method in ..
try{
execute method()
} catch(Exception e)
{
e.printkStrace();
}
finally{
close connection;
}
It might helps u.
Thanks,
Lohi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Aparna ,
I suggest You to execute your code for disconnecting RFC connection
in a seperate method. Your code must be enclosed with exception Handling codes.
You can place this method in your component Conroller[Reason: you can call your method from any View ,Incase u may close the connection at any view] and call this method after the Last model execution or in the view4.
Regards,
Ramganesan K.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try this when instance model context...
MDL_Customer_Data_Create model_Customer_Data_Create = (MDL_Customer_Data_Create) WDModelFactory.getModelInstance(MDL_Customer_Data_Create.class, WDModelScopeType.TASK_SCOPE);
model_Customer_Data_Create.disconnectIfAlive();
Z_Hyd_0192_Ep_Input bapIn_Z_Hyd_0192_Ep = (Z_Hyd_0192_Ep_Input) model_Customer_Data_Create.createModelObject(Z_Hyd_0192_Ep_Input.class);
bapIn_Z_Hyd_0192_Ep.setE_Customer_Data(new Zzep_Customer_Data());
wdContext.nodeZ_Hyd_0192_Ep_Input().bind(bapIn_Z_Hyd_0192_Ep);
Hi Aparnna ,
you can write this
<ModelName> search=(<ModelName>)WDModelFactory.getModelInstance(<ModelName>.class);
search.disconnectIfAlive();
after try catch Statements where you execute your model.
or
You can also write...
wdContext.current<ModelName>.modelObject().modelInstance().disconnectIfAlive()
Regards
Sunitha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
We have wrote the same code after executing the model exactly like you have mentioned above, still we are getting the same error.
<ModelName> search=(<ModelName>)WDModelFactory.getModelInstance(<ModelName>.class);
search.disconnectIfAlive();
Please Provide any other suggestion to solve the error.
Regards
Aparnna
Hi Aparna,
No need to close the JCO connections manually, vwhen you create JCo connections you will set connection time in milli seconds. By deafult its value is 10 msec. the connection will be closed , after the time specified.
Regards,
Siva.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
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.