on 07-10-2008 8:09 AM
Friends,
I have an application that uses a few models. As far as I understand each model receives an instance of JCO.
I have been advised in this forum to use
IWDDynamicRfcModel.setConnectionProvider() to tie up
all JCO instances into one. Unfortunately I do not know how to use this method.
Any insight will be highly appreciated
Humbly,
yuval peery
Hello Peery,
// two separate model instances are created ...
MyFirstModelTypemodelMyFirst=
(MyFirstModelType) WDModelFactory.getModelInstance(
MyFirstModelType.class,WDModelScopeType.APPLICATION_SCOPE);
MyOtherModelTypemodelMyOther=
(MyOtherModelType) WDModelFactory.getModelInstance(
MyOtherModelType.class,WDModelScopeType.APPLICATION_SCOPE);
// ... but the first model manages and provides the
// connection for the other model
modelMyOther.setConnectionProvider(modelMyFirst);
regards,
Sumit Malhotra
Award points if it useful to you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Yuval,
assume you have two models, ModelA and ModelB, and two corresponding instances, instA and instB.
instA.modelInstance().setConnectionProvider(instB.modelInstance());
Pay attention to few things:
If instB goes out of scope, you will get connection errors when trying to execute instA.
By default each model has an application scope. This means that if you create more instance of ModelA they share the same connections (so the above statement is not required). This also mean that the above statement influence every model of type ModelA that you create, not only instA.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.