| Bug #7508 | Releasing the environment handle is extremely slow with MyOdbc v3.51.10 | ||
|---|---|---|---|
| Submitted: | 23 Dec 2004 14:47 | Modified: | 26 Jan 2005 20:54 |
| Reporter: | [ name withheld ] | Email Updates: | |
| Status: | Can't repeat | Impact on me: | |
| Category: | Connector / ODBC | Severity: | S2 (Serious) |
| Version: | MySql v4.1.8 + MyOdbc v3.51.10 | OS: | Windows (WinXP + SP2) |
| Assigned to: | CPU Architecture: | Any | |
[29 Dec 2004 9:09]
[ name withheld ]
I just found out the problem doesn't occur on machines which have a fresh install (i.e., which have never had MySql Server or MyOdbc yet). I've tested with 3 computers by upgrading them from an earlier version of MySql and MyOdbc and all have trouble. I've installed 2 computers completely fresh and both work fine.
[26 Jan 2005 20:54]
Jorge del Conde
Hi! I was unable to reproduce this behaviour. I had MyODBC 3.51.9 and then I upgraded to 3.51.10 to see if this happened. Do you have any other information that will enable us to reproduce this bug ?

Description: I have an application which connects and disconnects multiple (and different types of) databases. Unfortunately, disconnecting from a MySql database is extremely slow (takes about 10 seconds) with MyOdbc v3.51.10. I use the following routine to disconnect from a database: // This function disconnects the link with the database void CDataBase::DisConnect(const CSignature sig) { try { CHECK_MEM_LEAKS; // We are no longer connected m_bConnected = false; // Go through all the statement handles for(uint8 u8=0;u8<CDB_TOT_QUERIES;u8++) { // Release the result set m_pQuery[u8].ReleaseQuery(sig); // Free the statement handle m_pQuery[u8].FreeStatementHandle(); } // Do we have a connection handle? if(m_hSqlDbc) { // Disconnect from the database, and release the handle SQLDisconnect(m_hSqlDbc); SQLFreeHandle(SQL_HANDLE_DBC, m_hSqlDbc); m_hSqlDbc = NULL; } // Do we have an environment handle? if(m_hSqlEnv) { // Release the environment SQLFreeHandle(SQL_HANDLE_ENV, m_hSqlEnv); m_hSqlEnv = NULL; } // Do we have a DSN environment handle? if(m_hSqlEnvDsn) GetDataSourceNames(sig, CDB_DSN_RELEASE); } catch(...) { OnException(__FILE__, __LINE__, __FUNCSIG__, __TIMESTAMP__); } } The following line is important: SQLFreeHandle(SQL_HANDLE_ENV, m_hSqlEnv); When this line executes, it takes about 10 seconds before it returns. I have tested the following drivers: MyOdbc v3.51.04 -> OK MyOdbc v3.51.06 -> OK MyOdbc v3.51.10 -> BAD Unfortunately, I don't have any other versions I can check. How to repeat: Connect to a MySql database, then disconnect. When freeing the environment handle, it will take a long time. SQLFreeHandle(SQL_HANDLE_ENV, m_hSqlEnv); Suggested fix: I don't know. Something changed between v3.51.06 and v3.51.10 which makes releasing the environment handle slow.