Skip to Content
author's profile photo Former Member
Former Member

use SAPConnectionPool in IIS with SAP .NET Connector

Hi, Gurus

I am using SAP .NET Connector to retrieve data from a SAP server in a .NET project(ASP.NET+VB.NET,...).

It is a web application, and I want to use Connection Pool in IIS (v 5.1) to pre-create connections

to SAP server. I read some documents about connection pool with Sql Server, and I know that the IIS can automatically use its connection pool mechanism.

But I have no idea about how to config the Connection Pool with SAP server. My questions are:

1) Should I do some configuration in SAP Server so that the SAP server can let IIS use its connections as a pool?

2) How to config the Connection Pool in IIS? I have no idea about the web.config file. I don't know what the elements and attributes when modifying this file. and also don't know where should I put the node? How to make it useful with program? I know the Config.ConnectionPoolSettings class has some properties such as MaxCapacity, MaxOpenConnections,....

My question is how to use this class to set the ConnectionPool and how to prove that the pool is active and in use? Is there any tools to observe the connection pool? Use SAPConnectionPool class?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Jan 31, 2005 at 09:51 AM

    SAP .NET Connector's connection pool is easy to understand and use; and it's completely independent from other pooling, like IIS Application Pools and so on:

    - The ConnectionPool is a static collections of opend, but unused connections.

    - It's effective if you have many usages of a SAP Connection with SAME connection string sequentially (NOT in parallel).

    You use is by SAP.Connector.Connection.GetConnectionFromPool() to get an unused connection (or create a new one if there is none) and SAP.Connector.Connection.ReturnConnection() to put it back into pool.

    You can also use AutoPooling. Turn it on by setting the

    SAP.Connector.Config.ConnectionPoolSettings.UseAutoPooling = True

    or set it in the Web.Config. You find an example of the necessary entry in the documentation of SAP.Connector.Config class.

    - If AutoPooling is on, each call to SAP.Connector.GetConnection() will try to take the connection from pool and each call to <connection>.Dispose will put it back. Dispose is sometimes called automatically by some magic in the page.

    - You can see the effect of connection pooling by looking into the Gateway monitor of the of the SAP Server(s). You would see longer open connections here.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Reiner Hille-Doering

      i changed the settings such as

      SAP.Connector.Config.Instance.ConnectionPool.MaxOpenConnections = 3


      and tested how many conns i can get in a loop.

      It works such as what i wanted.

      Reiner Hille-Doering! Thank you very much.

      you are our sunshine.


Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.