cancel
Showing results for 
Search instead for 
Did you mean: 

Connection Pooling with SAP.NET connector

Former Member
0 Kudos
465

Hi,

I'm using the connectionpool class of the SAP.NET connector...

e.g.

where BPartnerProxy is the proxy object.

BPartnerProxy.Connection = SAP.Connector.SAPConnectionPool.GetConnection(ConfigurationSettings.AppSettings("SAPConnectionString"))

and then the code to return the connection after the RFC call is made:

SAP.Connector.SAPConnectionPool.ReturnConnection(BPartnerProxy.Connection)

How do you manage the pool i.e. create a pool of x number of connections or see how many connections are left in the pool...?

Regards

Nick Wright

Accepted Solutions (0)

Answers (1)

Answers (1)

reiner_hille-doering
Active Contributor
0 Kudos

Hello Nick,

the connection pool is configured using the app.config / web.config file of you application.

Here's an example:

Statistic about the connection pool is currently not available. This feature will be added in next version.

Reiner.

Former Member
0 Kudos

Hi Reiner,

Thanks for your reply....

If the InitialCapacity was set to 50

Would I still use the same connection string as I would with a sap server proxy object e.g.

"CLIENT=040 User=username PASSWD=**** ASHOST=*...* SYSNR=0"

i.e. create 50 connections logging onto the same user...

Does the SAP system itself have any constraints, re: the number of sessions one user might have...?

Regards

Nick Wright

reiner_hille-doering
Active Contributor
0 Kudos

Hello Nick,

sorry, I don't fully understand your question.

When you use connection pooling, the connector will reuse connections from pool, that had the exacly same connection string then the new connection. I will thus work very effictively, when you have only a view different connection strings that is shared by an app in different moments.

So if you connect to the SAP system with the same or different connection string concurrently say 50 times, you create 50 connections. The number of concurrent connections that a SAP server accepts is configurable in the profile (don't ask me for the parameter name(s).) It also depends if you are using Load Balancing or not.

Note that all newer system don't like to have multile conections for the same user in parallel, as this could likely cause license violations.

Regards,

Reiner.

Former Member
0 Kudos

Hi Reiner,

Is there also a setting in the ConnectionPool for setting the maximum number of connections a connection pool can make use of? And a setting for the timeOut period.

If we are using a test tool like the one Microsoft, the web application takes up all available dialog processes. We want to be able to manage this.

Are these settings (like InitialCapacity) directly sent to the Jco 2.1.1 which lies beneath the .Net Connector.

If yes, could we use the Jco settings MaxPoolSize, MaxConnections, MaxWaitTime, or are these built in the new version of the .Net Connector (when is a new version expected?).

I hope you can provide us with these answers.

Best regards,

Edwin Kense.

reiner_hille-doering
Active Contributor
0 Kudos

Hello Edwin,

the connection pool is not made to limit concurrent ACTIVE connections; it's made to reuse NON-ACTIVE connections.

There is no featuere to limit active connections in NCo, but you can easily add it by your own: Whenever you creae a connection (or fetch it from the pool), you increase a counter. When you close it or return it to pool, you decrease the counter. When the counter reaches a limit during creation of a connection, you block.

Regards,

Reiner.