on 07-19-2007 10:14 AM
Hi.
I am writing an application in C# that connects to SAP as a client
and a server using the SAP .NET connector 2.0.
How do I configure connection pooling for the .NET connector
(switch it on /off, set the paramters etc.) ?
What are the default values for the connection pooling
parameters ?
Can anyone give me some excample code or links that could
give me information about this subject ?
Thanks a lot to everyone in advance.
Best regards,
Fred
Hi Alfred,
You can find detailed information in .net help searching SAP, Connection Pool.
I want to explain with an example ;
<configuration>
<SAP>
<Connector>
<ConnectionPool UseAutoPooling="True" MaxOpenConnections="100" MaxCapacity="5" MaxIdleTime="200"/>
</Connector>
</SAP>
</configuration>
You need to insert these SAP tags under configuration in web.config file. The parameters are ;
UseAutoPooling - You are saying that I will use Connection Pool
MaxOpenConnections - saying that at any time, maximum open connection number will be 100
MaxCapacity - You are saying that Connection Pool will hold maximum 5 open connection in pool
MaxIdleTime - You are saying that, an open connection in pool will be deleted after 200 minutes when connection returned to pool.
In your code, you are using Connector.GetConnectionFromPool() and ReturnConnectionToPool, maybe the method names are wrong, you can look at details these methods.
ps : Don't forget to give rewarding points if helpful
Best Regards,
Huseyin Akturk
SW Engineer & SAP ABAP Consultant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
The SAP.Connector.Config class has several nested parameters which can be used to configure the Connection Pool.
You can keep the settings in Web.Config something like-
<sectionGroup name="SAP">
<section name="Connector" type="SAP.Connector.SectionHandler, SAP.Connector, Version=2.0.0.0, Culture=neutral, PublicKeyToken=50436dca5c7f7d23"/>
</sectionGroup>
<SAP>
<Connector>
<ConnectionPool
UseAutoPooling="True"
MaxIdleTime="25"
MaxCapacity="45"
/>
</Connector>
</SAP>
Parameters are-
CleanupInterval
MaxCapacity
MaxOpenConnections
UseAutoPooling
MaxIdleTime
You can set the values of these parameters depending upon your application requriement.
Then in the code you can use method 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.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
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.