Bug #17024 Updated: Unexpected blocking
ID: 17024 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Bogus Bug Type: ODBC related Operating System: W2K Server PHP Version: 4.2.0 New Comment: Further investigation revealed this to be related to sessions, not odbc. Sorry! Previous Comments: [2002-05-06 08:29:31] [EMAIL PROTECTED] My bad for not cleaning my code up entirely before posting it; here is the same program with all unnecessary items removed. Ed. #include #include #include #include #include #include #include #include main(int argc,char * argv[]) { SQLHENV myEnvHandle;// odbc environment handle SQLHDBC myDbcHandle;// obdc connection handle SQLHSTMT myStmtHandle; int rc; // return code for various system calls std::string myDSN = "ehp"; // DSN to connect using std::string myUserName = "ehp"; // login to use when connecting std::string myPassWord = "ehp"; // password to use when connecting std::string myQuery = "select 'Hello, World'"; // set up an ODBC environment handle, request ODBC V3, set up an ODBC connector handle if ((rc=SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &myEnvHandle))!=SQL_SUCCESS) { exit(5001); } if ((rc=SQLSetEnvAttr(myEnvHandle, SQL_ATTR_ODBC_VERSION, (SQLPOINTER) SQL_OV_ODBC3,0))!=SQL_SUCCESS) { exit(5002); } if ((rc=SQLAllocHandle(SQL_HANDLE_DBC, myEnvHandle, &myDbcHandle))!=SQL_SUCCESS) { exit(5003); } // connect the ODBC connector handle to DSN rc = SQLConnect(myDbcHandle, (SQLCHAR *) myDSN.c_str(), (SQLSMALLINT) myDSN.size()+1, (SQLCHAR *) myUserName.c_str(), (SQLSMALLINT) myUserName.size()+1, (SQLCHAR *) myPassWord.c_str(), (SQLSMALLINT) myPassWord.size()+1); if ((rc!=SQL_SUCCESS)&&(rc!=SQL_SUCCESS_WITH_INFO)) { exit(5020); } int SCV=SQL_CONCUR_VALUES; // set the connection attributes for server-side cursors if ((SQLSetConnectAttr(myDbcHandle,SQL_ATTR_CONCURRENCY,(void *) SQL_CONCUR_VALUES,0))!=SQL_SUCCESS) { exit(5021); } // create a statment handle if ((SQLAllocHandle(SQL_HANDLE_STMT, myDbcHandle, &myStmtHandle))!=SQL_SUCCESS) { exit(5011); } // prepare a statement if((SQLPrepare(myStmtHandle, (unsigned char *) myQuery.c_str(),SQL_NTS))!=SQL_SUCCESS) { exit(5044); } // note that no query actually gets executed // this is where the long-running activities occur, I'll just sleep to simulate it though Sleep(3); return 0; } [2002-05-05 22:41:32] [EMAIL PROTECTED] I am seeing some unexpected blocking of PHP/ODBC scripts. I'm running the two scripts in two separate browser windows. If the first PHP script is running, and the second PHP script is started, the second script won't run until the first one completes. I've isolated this down to either apache or php blocking. I'm unable to trace any further, but willing to assist, and grant access to my server. My platform is W2K Server w/SP2, SQL Server 2000 8.00.194, Apache, and php 4.2.0 (binary distribution). I'm embarassed to say I don't know how to determine the exact version of apache I've installed, but it is 1.3.x. I have two scipts and one C++ program that illustrate the issue; you'll need VC++ to compile this (or I can send the EXE file to you). ---helloA.php- -- ---helloB.php- -- ---phpbug.cpp- #include #include #include #include #include #include #include #include #include "tapeUtilNonOverlapped.h" #define createSqlStmtHandle(connectionHandle, newStmtHandle) { \ SQLRETURN rc; \ if ((rc = SQLAllocHandle(SQL_HANDLE_STMT, connectionHandle, &newStmtHandle))!=SQL_SUCCESS) { \ char mySQLState[10]; \ long myNativeError; \ char myMsgText[300]; \ short lengthOfMyMsgText; \ SQLGetDiagRec(SQL_HANDLE_STMT, newStmtHandle, 1, (unsigned char *) mySQLState, &myNativeError, (unsigned char *) myMsgText, 300, &lengthOfMyMsgText); \ exit(5011); \ } \ } void ehpSqlPrepare(SQLHSTMT handle, std::string sqlCmd) { SQLRETURN rc = SQLPrepare(handle, (unsigned char *) sqlCmd.c_str(),SQL_NTS); if (rc!=SQL_SUCCESS) { char
Bug #17024 Updated: Unexpected blocking
ID: 17024 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: ODBC related Operating System: W2K Server PHP Version: 4.2.0 New Comment: My bad for not cleaning my code up entirely before posting it; here is the same program with all unnecessary items removed. Ed. #include #include #include #include #include #include #include #include main(int argc,char * argv[]) { SQLHENV myEnvHandle;// odbc environment handle SQLHDBC myDbcHandle;// obdc connection handle SQLHSTMT myStmtHandle; int rc; // return code for various system calls std::string myDSN = "ehp"; // DSN to connect using std::string myUserName = "ehp"; // login to use when connecting std::string myPassWord = "ehp"; // password to use when connecting std::string myQuery = "select 'Hello, World'"; // set up an ODBC environment handle, request ODBC V3, set up an ODBC connector handle if ((rc=SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &myEnvHandle))!=SQL_SUCCESS) { exit(5001); } if ((rc=SQLSetEnvAttr(myEnvHandle, SQL_ATTR_ODBC_VERSION, (SQLPOINTER) SQL_OV_ODBC3,0))!=SQL_SUCCESS) { exit(5002); } if ((rc=SQLAllocHandle(SQL_HANDLE_DBC, myEnvHandle, &myDbcHandle))!=SQL_SUCCESS) { exit(5003); } // connect the ODBC connector handle to DSN rc = SQLConnect(myDbcHandle, (SQLCHAR *) myDSN.c_str(), (SQLSMALLINT) myDSN.size()+1, (SQLCHAR *) myUserName.c_str(), (SQLSMALLINT) myUserName.size()+1, (SQLCHAR *) myPassWord.c_str(), (SQLSMALLINT) myPassWord.size()+1); if ((rc!=SQL_SUCCESS)&&(rc!=SQL_SUCCESS_WITH_INFO)) { exit(5020); } int SCV=SQL_CONCUR_VALUES; // set the connection attributes for server-side cursors if ((SQLSetConnectAttr(myDbcHandle,SQL_ATTR_CONCURRENCY,(void *) SQL_CONCUR_VALUES,0))!=SQL_SUCCESS) { exit(5021); } // create a statment handle if ((SQLAllocHandle(SQL_HANDLE_STMT, myDbcHandle, &myStmtHandle))!=SQL_SUCCESS) { exit(5011); } // prepare a statement if((SQLPrepare(myStmtHandle, (unsigned char *) myQuery.c_str(),SQL_NTS))!=SQL_SUCCESS) { exit(5044); } // note that no query actually gets executed // this is where the long-running activities occur, I'll just sleep to simulate it though Sleep(3); return 0; } Previous Comments: [2002-05-05 22:41:32] [EMAIL PROTECTED] I am seeing some unexpected blocking of PHP/ODBC scripts. I'm running the two scripts in two separate browser windows. If the first PHP script is running, and the second PHP script is started, the second script won't run until the first one completes. I've isolated this down to either apache or php blocking. I'm unable to trace any further, but willing to assist, and grant access to my server. My platform is W2K Server w/SP2, SQL Server 2000 8.00.194, Apache, and php 4.2.0 (binary distribution). I'm embarassed to say I don't know how to determine the exact version of apache I've installed, but it is 1.3.x. I have two scipts and one C++ program that illustrate the issue; you'll need VC++ to compile this (or I can send the EXE file to you). ---helloA.php- -- ---helloB.php- -- ---phpbug.cpp- #include #include #include #include #include #include #include #include #include "tapeUtilNonOverlapped.h" #define createSqlStmtHandle(connectionHandle, newStmtHandle) { \ SQLRETURN rc; \ if ((rc = SQLAllocHandle(SQL_HANDLE_STMT, connectionHandle, &newStmtHandle))!=SQL_SUCCESS) { \ char mySQLState[10]; \ long myNativeError; \ char myMsgText[300]; \ short lengthOfMyMsgText; \ SQLGetDiagRec(SQL_HANDLE_STMT, newStmtHandle, 1, (unsigned char *) mySQLState, &myNativeError, (unsigned char *) myMsgText, 300, &lengthOfMyMsgText); \ exit(5011); \ } \ } void ehpSqlPrepare(SQLHSTMT handle, std::string sqlCmd) { SQLRETURN rc = SQLPrepare(handle, (unsigned char *) sqlCmd.c_str(),SQL_NTS); if (rc!=SQL_SUCCESS) { char mySQLState[10]; long myNativeError; char myMsgText[300]; short lengthOfMyMsgText; rc = SQLGetDiagRec( SQL_HANDLE_STMT, handle, 1, (unsigned char *)
Bug #17024: Unexpected blocking
From: [EMAIL PROTECTED] Operating system: W2K Server PHP version: 4.2.0 PHP Bug Type: ODBC related Bug description: Unexpected blocking I am seeing some unexpected blocking of PHP/ODBC scripts. I'm running the two scripts in two separate browser windows. If the first PHP script is running, and the second PHP script is started, the second script won't run until the first one completes. I've isolated this down to either apache or php blocking. I'm unable to trace any further, but willing to assist, and grant access to my server. My platform is W2K Server w/SP2, SQL Server 2000 8.00.194, Apache, and php 4.2.0 (binary distribution). I'm embarassed to say I don't know how to determine the exact version of apache I've installed, but it is 1.3.x. I have two scipts and one C++ program that illustrate the issue; you'll need VC++ to compile this (or I can send the EXE file to you). ---helloA.php- -- ---helloB.php- -- ---phpbug.cpp- #include #include #include #include #include #include #include #include #include "tapeUtilNonOverlapped.h" #define createSqlStmtHandle(connectionHandle, newStmtHandle) { \ SQLRETURN rc; \ if ((rc = SQLAllocHandle(SQL_HANDLE_STMT, connectionHandle, &newStmtHandle))!=SQL_SUCCESS) { \ char mySQLState[10]; \ long myNativeError; \ char myMsgText[300]; \ short lengthOfMyMsgText; \ SQLGetDiagRec(SQL_HANDLE_STMT, newStmtHandle, 1, (unsigned char *) mySQLState, &myNativeError, (unsigned char *) myMsgText, 300, &lengthOfMyMsgText); \ exit(5011); \ } \ } void ehpSqlPrepare(SQLHSTMT handle, std::string sqlCmd) { SQLRETURN rc = SQLPrepare(handle, (unsigned char *) sqlCmd.c_str(),SQL_NTS); if (rc!=SQL_SUCCESS) { char mySQLState[10]; long myNativeError; char myMsgText[300]; short lengthOfMyMsgText; rc = SQLGetDiagRec( SQL_HANDLE_STMT, handle, 1, (unsigned char *) mySQLState, &myNativeError, (unsigned char *) myMsgText, 300, &lengthOfMyMsgText); std::string err = "ehpSqlPrepare: couldn't prepare handle: "; err.append(myMsgText, lengthOfMyMsgText); exit(5010); } } main(int argc,char * argv[]) { SQLHENV myEnvHandle;// odbc environment handle SQLHDBC myDbcHandle;// obdc connection handle SQLHSTMT myStmtHandle; int rc; // return code for various system calls std::string myDSN = "ehp"; // DSN to connect using std::string myUserName = "ehp"; // login to use when connecting std::string myPassWord = "ehp"; // password to use when connecting std::string myQuery = "select 'Hello, World'"; // set up an ODBC environment handle, request ODBC V3, set up an ODBC connector handle if ((rc=SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &myEnvHandle))!=SQL_SUCCESS) { exit(5001); } if ((rc=SQLSetEnvAttr(myEnvHandle, SQL_ATTR_ODBC_VERSION, (SQLPOINTER) SQL_OV_ODBC3,0))!=SQL_SUCCESS) { exit(5002); } if ((rc=SQLAllocHandle(SQL_HANDLE_DBC, myEnvHandle, &myDbcHandle))!=SQL_SUCCESS) { exit(5003); } // connect the ODBC connector handle to DSN rc = SQLConnect(myDbcHandle, (SQLCHAR *) myDSN.c_str(), (SQLSMALLINT) myDSN.size()+1, (SQLCHAR *) myUserName.c_str(), (SQLSMALLINT) myUserName.size()+1, (SQLCHAR *) myPassWord.c_str(), (SQLSMALLINT) myPassWord.size()+1); if ((rc!=SQL_SUCCESS)&&(rc!=SQL_SUCCESS_WITH_INFO)) { exit(5020); } int SCV=SQL_CONCUR_VALUES; // set the connection attributes for server-side cursors if ((SQLSetConnectAttr(myDbcHandle,SQL_ATTR_CONCURRENCY,(void *) SQL_CONCUR_VALUES,0))!=SQL_SUCCESS) { exit(5021); } // create a statment handle if ((SQLAllocHandle(SQL_HANDLE_STMT, myDbcHandle, &myStmtHandle))!=SQL_SUCCESS) { exit(5011); } // prepare a statement if((SQLPrepare(myStmtHandle, (unsigned char *) myQuery.c_str(),SQL_NTS))!=SQL_SUCCESS) { exit(5044); } // note that no query actually gets executed // this is where the long-running activities occur, I'll just sleep to simulate it though Sleep(3); return 0; } -- Edit bug report at http://bugs.php.net/?id=17024&edit=1 -- Fixed in CVS:http://bugs.php.net/fix.php?id=17024&r=fixedcvs Fixed in release:ht