Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

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

$
0
0

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 setSQL_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.


Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>