TransWikia.com

how to use the pool connection correctly?

Server Fault Asked by Lucas Muñoz on November 25, 2020

i’m developing an application in C#, where a "pooling" will be carried out to connect to the database. The database used is SYBASE

I currently have the following connection string in my DataAccess class

using Sybase.Data.AseClient;

public static AseConnection PoolTest(){
    string stringConnection = "Provider=Sybase ASE OLE DB Provider;Data Source=localhost,5000;Database=Test;Uid=SVJ;Pwd=123456;" +
                                "Pooling=true;" +
                                "Max Pool Size=15;" +
                                "Min Pool Size=1;" +/*
                                "ConnectionReserveTimeout=3;" +*/
                                "Connection Timeout=10;" +
                                "Connection Lifetime=1;" +
                                "ConnectionIdleTimeout=1;";
                    conn = new AseConnection();
                    conn.ConnectionString = stringConnection ;
}

Now, at the moment of calling the instance and generating the connection, they are created without any inconvenience, but after finishing my process, I end my connection with conn.Close() and in the database engine when looking at the existing connections, they stay there in a "AWAITING COMMAND" state for an indefinite period and this causes me problems when trying to perform another action in the application since the pool is full, and it is supposed to use the connections that are in status "AWAITING COMMAND"

I understand that if I terminate the connection in my App controller, it closes automatically in the DB engine, if someone can clarify for me if it is normal for this to happen, or if I have any wrongly defined parameters, I thank you in advance.

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP