cancel
Showing results for 
Search instead for 
Did you mean: 

.net connector maximum pool size

Former Member
0 Kudos

i am SAP .net connector to use RFC

how do i define the maximum pool size

I have used the following code

SAP.Connector.Destination dest = new SAP.Connector.Destination();

dest.ConnectionString = "ASHOST=xx SYSNR=xx CLIENT=xx USER=xx PASSWD=xx MaxPoolSize=xx";

SAP.Connector.Connection connection = SAP.Connector.SAPConnectionPool.GetConnectionFromPool(dest);

Alternatively i have also tried

SAP.Connector.Destination dest = new SAP.Connector.Destination();

dest.AppServerHost = ConfigurationManager.AppSettings["SAP_SERVER"];

dest.Client = xx;

dest.Password = ConfigurationManager.AppSettings["SAP_PWD"];

dest.SystemNumber = 00;

dest.Username = ConfigurationManager.AppSettings["SAP_UNAME"];

SAP.Connector.Connection connection = SAP.Connector.SAPConnectionPool.GetConnectionFromPool(dest);

and to return the connection

public void RetConnection(SAP.Connector.Connection RetCon)

    {

        if (RetCon != null)

        {

            RetCon.PrepareForPooling();

            SAP.Connector.SAPConnectionPool.ReturnConnection(RetCon);

           RetCon = null;

        }

    }

pl help me with what i should use to set my connection pool size

Thanks & Regards

Jayapriya

Accepted Solutions (0)

Answers (2)

Answers (2)

MarkusTolksdorf
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Jayapriya,

You are not referring to NCo 3.0 configuration, hence there is different configuration options,not PeakConnectionsLimit or MAX_POOL_SIZE. Actually, your code looks more or less like NCo 2.x. NCo 2 has MaxCapacity and MaxOpenConnections. Check whether those are helpful for you. Nevertheless, I would recommend to you that you migrate your application to 3.0 - NCo 2.0 has gone out of support over a year ago.

Best regards,

Markus

hynek_petrak
Active Participant
0 Kudos

I used this way (RfcConfigParameters.PeakConnectionsLimit and RfcConfigParameters.PoolSize), where cd is an implementation of IDestinationConfiguration:


RfcConfigParameters cd = new RfcConfigParameters();

                if (s.LoadBalancing) {

                    cd.Add(RfcConfigParameters.MessageServerHost, s.Server);

                    cd.Add(RfcConfigParameters.MessageServerService, s.MsgSrvPort.ToString());

                    cd.Add(RfcConfigParameters.LogonGroup, s.LogonGroup);

                } else {

                    cd.Add(RfcConfigParameters.AppServerHost, s.Server);

                    cd.Add(RfcConfigParameters.SystemNumber, s.SystemNumber);

                }

                cd.Add(RfcConfigParameters.Client, s.Client);

                cd.Add(RfcConfigParameters.SystemID, s.ID);

                cd.Add(RfcConfigParameters.User, s.User);

                cd.Add(RfcConfigParameters.Password, s.Password);

                cd.Add(RfcConfigParameters.Codepage, "1100");

                cd.Add(RfcConfigParameters.Language, "E");

                cd.Add(RfcConfigParameters.PeakConnectionsLimit, "150");

                cd.Add(RfcConfigParameters.PoolSize, "1");

                //cd.Add(RfcConfigParameters.UseSAPGui, "2");

                dm.AddConnectionDetails(s.ID, cd);