cancel
Showing results for 
Search instead for 
Did you mean: 

How does METADATA_DEST connections work in Web Dynpro?

Former Member
0 Kudos

Hi,

We are using Adaptive RFC model to connect to a BAPI in R/3. In our setting, we are building 4 Web Dynpro apps (integrated in EP iViews) but since all of them talk to the same BAPI, we have all these apps point to the same METADATA_DEST (the MODELDATA_DEST is not share but configured to use sso). The METADATA_DEST setting is below:

Max. pool size: 1

Max connections: 10

Conenction Timeout: 60

Max waiting time: 10

To our understanding, the web dynpro framework establishs the metadata connection at the first access to the app. But since all the 4 apps point to the same METADATA_DEST, we expect there should only be 1 METADATA connection established which shares between the apps. This is different from our observation in SM04. Throughout a stress test, we see the number of metadata connection in SM04 can be up to 6 or more. Even though after we finished the test. Only some of the connections in SM04 were cleared. At the end we still have 4 metadata connections showing in SM04 that were never clear by itself unless we restart the WAS (EP server).

Our questions are:

1. Is the behavior above normal? Meaning that should we see 4 metadata connections or 1 showing in SM04?

2. Since the max. pool connection for the METADATA_DEST was set to 1, shouldn't it mean the server only cache 1 connection? But then why we see 4 connections in SM04 that cannot be cleared by itself?

3. In another test where the Web Dynpro apps are running without EP. We see only 1 metadata connection show in SM04 even though we are running all 4 apps at the same time. Is there any difference in the handling of the METADATA_DEST when the Web Dynpro app is running in EP?

FYI, we are running on WAS6.40 / EP6 SP12.

Any comment is welcome. Thanks a lot for your help.

Regards,

Marc

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi marc

Well when you have 4 different WebDynpro Apps, are they in a single WebDynpro project or 4 separate projects.

It is mainly because of the way you have created Models in your WebDynpro App. It depends on that.

The concept is something like this

You could have a Model which could consist of multiple RFC's or a single RFC. But when you establish the connection a Single instance of the Model is created at runtime and the connection is maintained.

Note : WD_MODEL_DATA and WD_RFC_METADATA are used by one Model. In your case 4 WebDynpro Apps will instantiate 4 different model instances. As a result in your SM04 you will see 4 connections.

I dont know if i have really conveyed it in a very simple manner. Let me know if you still require any more information.

regards

Ravi

Former Member
0 Kudos

Thanks Ravi for the help.

FYI, these 4 Web Dynpro apps are from different projects with seperate deployments. You might be right that since they are in different model instances perhaps they create and cache a connection for each app. However, from our tests, we see the follows that we can't explain:

1. During the stress test (with EP), we saw more than 4 metadata connections opened in SM04 once a while. If each app cache exactly 1 connection then we should only have 4 opened but not more than it. Is this behavior normal? Is the connection really bind to the number of apps or to the concurrent accesses?

2. In another test without EP, we see these 4 apps sharing the same metadata connection. Meaning that in SM04 there is always just exactly one connection show up with timestamp updated each time another app access it. The configuration is exactly the same as the other test only that the web dynpro apps are not runing in EP. What is it different?

Thanks for your help again.

Regards,

Marc

Former Member
0 Kudos

hi

Even i dont know why you are getting extra connections. When you said you run 4 WebDynpro apps without EP you will have only one as at one point of time you will have only one model instance.

Remember that though WD_RFCMETADATA_DEST is only one. The number of instances a model creates it uses that many connections.

Are you disconnecting the model after every RFC execute meaning

if your model is say RFCModel then

RFCModel model = (RFCModel)WDModelFactory.getModelInstance(RFCModel.class,APPLICATION_SCOPE);

model.disconnectIfAlive();

Your connections will not be automatically disconnected until you explicity close them. Maybe that could be a reason for your extra connections.

let me know if you require more help

regards

Ravi

Former Member
0 Kudos

Thanks Ravi, but we are using TASK_SCOPE for the rfc model here. The connection should be closed whenever the task is done, but I believe that's only for the MODELDATA (not sure for METADATA if it is the same but I don't think model.disconnectIfAlive() is applicable to TASK_SCOPE).

Anyway, so you mean if we have users accessing the 4 apps at the same point of time the behavior of having 4 metadata connections created in SM04 is normal? For example, if we have 6 users accessing these apps at the same point of time, 6 metadata connections should be fetched and kept in SM04? Then when will these connections be closed? My understanding is metadata connections won't be closed until the server restarts. If that's the case, that will be a problem if we have a lot of concurrent users accessing it at the same time as there is no control of it.

Any comment?

Thanks,

Marc

Former Member
0 Kudos

Hi

Refer to this link . It will give an insight. Dont know if you have already checked this document. But it is really useful.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/11c3b051-0401-0010-fe9a-9ea...

Secondly we have faced problems when multiple concurrent users log in as R/3 says maximum number of connections reached. This has happened sometimes. We dont know what the limit is. From your observation i guess this should have been the problem at that time.

We had to monitor SM04 and delete unwanted RFC connections.BTW What do you observe in SM04.

As you are using SSO, say if 10 users log in concurrently then in your SM04 you should see connection as RFC along with the respective user names of 10 users.

For metadata you would have configured it to a specific user right. you will see a RFC with a username as blank in SM04.

Now for the analysis check and see how many RFC connections with blank user names are there. That should tell you if metadata connections are one or more.

Ensure that SM04 is clear before you start this exercise.

I guess that should exactly tell how the connections are behaving :).

But i am not having access to a WebAS system currently. I will be having it on Tuesday. Then i should be able to check it out.

But just check the document and see if that helps.

Hope that helps

regards

Ravi

Former Member
0 Kudos

Thanks a lot Ravi, the doc is useful. We ran the test in clean again. Unfortunately we are still unable to explain the behavior with the info from the doc. Here I'm giving you the background and the detail of the new test:

Background:

We have 4 Web Dynpro apps each of them in a seperate project (i.e. 4 wd archives). Each project has exactly one Adaptive RFC model corresponds to a set of BAPIs these project needs. Amoung the rfc models in these 4 projects, since all the BAPIs correspond to the same R/3, they were setup to use the same METADATA_DEST. (The reason why we have model for each project is because these are all standalone projects with different purposes, although they are all pointing to the same backend).

Test:

- As you suggested, we restart the server and run a clean test again. All the metadata connections are carried out using a predefined user JCO-RFC. Throughout the test, we monitor SM04 to see the number of session from JCO-RFC in order to determine the number of metadata connections.

- As you explained, we should expect to have exactly 1 connection for each metadata model instance. So what we will monitor is to run these 4 apps one after one to see if a new connection is established at the first access of each app.

Test results:

- On the first access to the first app, we see 2 metadata session established in SM04. (I can't explain it from what the doc said).

- We tried to access the other 3 apps (all at first accesses). However, it will just reuse the 2 metadata connections already established in SM04 (we see the timestamp of these connections in SM04 updated), but not creating new connections for the model instances in these 3 apps (according to the doc it should fetch a new metadata connection for their first access).

- We put in more load to the system. At certain point we see the number of metadata connection in SM04 increases to 3 and then 4 (at one time it drop from 4 back to 3 but then it increases back to 4).

From the test results, we still have these questions:

1. Why did it create 2 metadata connection when accessing just 1 model instance?

2. When will the WD framework decide to create more metadata connections (in our test, increasing from 2 connections to 3 then 4)?

3. How to explain the behavior of metadata connections dropping from 4 to 3? At what scenario the wd framework decide to drop a metadata connection?

4. And most importantly, will the number of metadata connections grows more than the number of model instance we have? (we are still running the test to see when it happens) If so, will it accumulate? How do we manage these open connections?

Thanks again, and sorry for the lengthy message.

Regards,

Marc

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Marc,

My understanding is, METADATA_DEST is used for fetching metadata information. So, this connection is used only once. Afterwards there is no metter how much times same application runs from same client machine or different client machine. Now, when you restart server then only METADATA connection is used.

That means, METADATA connection is used only once in Server lifetime.

I don't know why you are getting these much connections.

Regards,

Bhavik

Former Member
0 Kudos

Hi all,

Thanks for the info. However, we still need a clarification on below:

1. If we have 4 apps sharing the same METADATA_DEST, should the web dynpro framework establish 1 connection and share between the apps or establish 4 connections for all the them? Which one is normal behavior?

2. If it should only establishes 1 metadata connection, then under what scenario will it create more than 1 (like in our case)?

3. If it should create 4 metadata connections (meaning 1 conn per apps), then under what scenario willl it create connections more than the number of apps (in our case, we saw 6 metadata connections for 4 apps)?

FYI, these web dynpro apps are in different projects meaning that they are in different dc, although we are not using componentization in this project.

Thanks again,

Marc

Former Member
0 Kudos

Hi Marc,

It is recommended to create a separate DC for the model, put all RFC's into that model, declare the model as a public part and use it from all other DC's. From my understanding you should only see one RFC connection in SM04 if this approach is used.

We actually have two models in our model DC one used for locking and the other for all other RFC's.

I don't know how that would work with WebDynpro projects though.

Cheers Lars