In Windows 2012-SQL 2012: ODBC connection hangs if connection pooling is enabled

Calling SQLSetEnvAttr to set SQL_ATTR_CONNECTION_POOLING value.

SQLSetEnvAttr(NULL, SQL_ATTR_CONNECTION_POOLING, (SQLPOINTER)SQL_CP_ONE_PER_HENV, SQL_IS_INTEGER);

 

Then calling SQLDriverConnect method causes the application to hang.

SQLDriverConnect(
                                        m_hdbc,
                                        NULL,
                                        sqltchConnStringIn,
                                        SQL_NTS,
                                        ConnStrOut,
                                        ONE_KB_SIZE,
                                        &cbConnStrOut,
                                        SQL_DRIVER_NOPROMPT);

If SQLSetEnvAttr is not called to set SQL_ATTR_CONNECTION_POOLING value, then the call goes through fine and the application does not hang.

The problem occurs only on Windows/SQL 2012. The problem does not occur in Windows 2008 R2/SQL 2008 R2 environment.

April 12th, 2014 8:29am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics