cancel
Showing results for 
Search instead for 
Did you mean: 

Some Questions about Connector 2.0

Former Member
0 Kudos

Hi Friends,

I have got some questions aboout Connector 2.0;

1. After I have implemented simple operations with RFC, I have seen that the pooling mechanism is handled by ISS (I am not sure absolutely this, I only realized, if I am wrong please inform). I have written an ASP.NET web application as;


SAP.Connector.Destination dest = new SAP.Connector.Destination();
dest.AppServerHost = "...";
dest.Username = "...";
dest.Password = "...";
dest.SystemNumber = .;
dest.Client = ..;
dest.Language = "..";

SAP.Connector.Connection conn =  SAP.Connector.SAPConnectionPool.GetConnection(dest);
conn.Open();

SAP.Connector.Connection conn2 =  SAP.Connector.SAPConnectionPool.GetConnection(dest);
conn2.Open();

SAP.Connector.Connection conn3 = SAP.Connector.SAPConnectionPool.GetConnection(dest);
conn3.Open();

After this code, these connections are stayed as open in SAP(I have checked from SM04)

When I have reset ISS, I saw that these open connections are removed from SAP. (Again SM04)

I want to ask that, if connections are handled by ISS, why there are some parameters in SAP such as

rdisp/rfc_pooling

rdisp/rfc_pool_size

rdisp/rfc_pool_timeout

? (I have seen these parameters from RZ11)

Are these parameters are not deal with our connector pooling mechanism? Or in another say, what and why are these parameters used for?

2. If I want to supply no boundary for MaxCapacity, to set value what? 0? And as same, no boundary for max open connection to set 0 enough? And same last, no boundary for MaxIdleTime of open connections stay set 0 enough? Or how?

3. Think that I have a web service in ASP.NET. this web service is a simple proxy for several SAP Systems and supplies RFC connections. Is it possible to implement pool for every SAP Systems in only one web service? If yes, how?

4. I want to ask that, if pooling mechanisim is handled by ISS, if we want to apply pooling mechanism in desktop applications (no relation with ISS), who handles pooling mechanism?

Accepted Solutions (0)

Answers (1)

Answers (1)

reiner_hille-doering
Active Contributor
0 Kudos

SAP .NET Connector's connection pooling is not handled by IIS, but by the Connector itself. The pool is simply a static ArrayList of open connection and a thread that closes unused connections after some time.

You code is not working as expected, because you never put a connection back into the pool.

Here's how it should look like:

SAP.Connector.Destination dest = new SAP.Connector.Destination();
dest.AppServerHost = "...";
dest.Username = "...";
dest.Password = "...";
dest.SystemNumber = .;
dest.Client = ..;
dest.Language = "..";
//...
SAP.Connector.Connection conn =  SAP.Connector.SAPConnectionPool.GetConnection(dest);
conn.Open();
SAPProxy1 proxy = new SAPProxy1();
proxy.Connection = conn;
// Do some calls here
proxy.Connection = null;
SAP.Connector.SAPConnectionPool.ReturnConnection(conn);

The most important statement is the last one that puts the connection into the pool. The connection stays open for configurable time for the case that later a connection is needed again based on the same destination (or on the same connection string).

The connecion pool is configured with several parameters nested in the class SAP.Connector.Config. Please see the online doku of this class. The mentioned parameters on ABAP size are not related to the .NET Connector.

2. Yes, setting MaxCapacity to 0 allows the pool to grow unlimited. This is also in the online doku (see class ConnectionPoolSettings).

However an unlimited timeout doesn't make a lot of sense: If you want to hold a connection open forever, just keep in somewhere in a variable.

3. I don't understand the question. Maybe you have a wrong understanding what the pool does: it's simply a cache of open unused connection and saves the time to close an reopen a connection to the same destination. It is <b>not</b> about sharing connections (which is not possible in RFC).

4. As I sayd the pool is just a static variable. So it is owned by the process that hosts the .NET Connector DLL. In Web case it is IIS (or more exactly ASPNETwp), else it's your app.

Former Member
0 Kudos

Thanks Reiner,

Lots of my problem about pooling are now clear.

But there some questions;

2.Before this application, I have been implemented my cache mechanism to supply connection in open state every time.(in Connector 1.1) The reason of how to supply the no boundary of connection time is to supply open connection every time. When I have checked the MaxIdleTime type is integer. I think to give bigger value for this parameter, but is there any condition the open time is adjusted also SAP Server?

3. If I want to supply there should be 3 open connection for example SAP Servers, I first think to hold one pool for every SAP Servers. It can be supplied to hold one parameter for every sap server. But i want to supply better solution such as using pool. Is there any solution? If yes, how?

Thanks.