SQL Server Performance

Connection Pooling

Discussion in 'Non-Transact SQL Developer Performance Tuning' started by pramodi, Nov 17, 2004.

  1. pramodi New Member

    Hi...
    Can anybody tell me when the connection pool is created ?
    What is the max and min pool size ?
    Can we do connection pooling using ADO in pure C++ code...

    I have written a simple code ...

    int main()
    {
    CoInitialize(NULL);
    _ConnectionPtr m_pConnection1;
    _ConnectionPtr m_pConnection2;

    m_pConnection1.CreateInstance(__uuidof(Connection));

    m_pConnection1->Open( "Provider='sqloledb';Data Source='localhost';Initial Catalog='Pubs';Integrated Security='SSPI';Min Pool Size=1;Max Pool Size=10;OLE DB Services=-1", "", "", adConnectUnspecified );
    m_pConnection1->Close();
    m_pConnection1->Open( "Provider='sqloledb';Data Source='localhost';Initial Catalog='Pubs';Integrated Security='SSPI';Min Pool Size=1;Max Pool Size=10;OLE DB Services=-1", "", "", adConnectUnspecified );
    m_pConnection1->Close();

    CoUninitialize();
    return 0;
    }


    Is the above code correct ?


  2. satya Moderator

Share This Page