on 01-15-2007 6:48 AM
Hi all,
I have a Web Dynpro project that I need to maintain.
The project uses 9 models (each model has 1 RFC).
I know that the best practice it to put all the RFCs in the same model but I can't do it and I'm looking for a workaround.
One way is to use disconnectIfAlive method - connections are being set on demand but I'm losing the ability to use pooling.
Second way is to use the set/get connectionProvider:
I know which RFC run first, before I executed the RFC, I used setConnectionProvider and save it in the context (in IWDDynamicModel object).
Beofre I run the rest of the RFCs, I use getConnectionProvider and I use the IWDDynamicModel from the context ( inputX.modelInstance().setConnectionProvider(rfcConnection) )
When I run SM04 in R3, I see that each user (in the same session) opens several connections instead of one.
How do I fix it?
Thanks,
Omri
Omri,
I tried setConnectionProvider method it did not work. Still it is creating many connections(SM04 ) in R/3. Any solution from any one?
Regards,
Ramana.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Omri Cohen
how did you solve the set connectionprovider? do you have example code or steps to do for me?
regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Eoin Cronan,
The best way is to put ALL your RFCs in one model.
If you can't do that than use the following workaround:
1) Define a variable of type 'com.sap.tc.webdynpro.modelimpl.dynamicrfc.IWDDynamicRFCModel' in the context (let's call it 'RfcConnection')
2) After you run your first RFC in the project, write the following code
IWDDynamicRFCModel rfcConnection = <model1l>.modelInstance().getConnectionProvider();
wdContext.currentContextElement().setRfcConnection(rfcConnection);
3) For all RFCs besides the first one write the following code before the 'execute' statement
<model2>.modelInstance().setConnectionProvider(wdContext.currentContextElement().getRfcConnection());
Omri
Omri,
First, make sure that you are not counting metadata connection along with data connection. Every RFC model has one metadata connection and one data connection. With setConnectionProvider you are changing data connection and it's impossible to change metadata connection programatically at all. So please verify what connections you are counting.
Valery Silaev
SaM Solutions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Valery,
It's the same METADATA connection for all models/rfcs.
I don't want to change the METADATA, just the MODELDATA.
The problem is with the MODELDATA connections (each user creates a lot of connections in R3. I know it because I use ticket for MODELDATA and fixed (system) user for METADATA)
Omri
Omri,
Then it seems that your assumption about "first invoked RFC" is wrong. Seems like other RFC-s has chance to be executed at least once before you redefined data connection. Probubly via some supply functions or via code executed from wdDoInit of defaulr visible view controllers / component controllers. This is next item to check.
Valery Silaev
SaM Solutions
Hi Valery,
I have a log in my application which writes every function/rfc name and execution time.
From this log I see which RFC is invoked first.
The output of this rfc is used as input in other RFCs so I'm sure it is the first.
Maybe I did something wrong in the implementation of the code.
I will try to post some code.
Omri
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.