Multi-threaded application doing MFC CDatabase->OpenEx()
Date: Wed, 30 Jun 1999 14:12:53 -0400
Message-ID: <377A5E25.DD1DD688_at_courion.com>
I have a mutlithreaded C++/MFC application (runs as an NT service or
interactively) that loads a DLL creates thread makes a call into the DLL
which makes a call to OpenEx() to open a DataSource to an Oracle DB
(doesn't matter if the DBServer is 7.3.4 or 8.0.5 or if the Oracle ODBC
Driver is the latest ORacle ODBC 7 driver or latest Oracle ODBC 8.0.5
driver or the Microsoft Oracle driver) I get ....
06/21/1999 15:42 -->State:08004,Native:12154,Origin:[Oracle][ODBC][Ora] State:IM006,Native:0,Origin:[Microsoft][ODBC Driver Manager] 06/21/1999 15:42 -->An exception occurred when attempting to open the database. Server rejected the connection. Driver's SQLSetConnectAttr failed
When I use the Oracle ODBCTest tool the Datasource works fine. The only difference is running as part of a multithreaded application. I had one Multithreaded problem fixed by applying RSF 7.3.4.1.1 - the problem report I found indicated that this RSF fixed a problem in the OCI layer. I am still suspect of the OCI layer. With SQLNET tracing turned on, no SQLNet trace logs are created. It isn't even getting to it.
What Connect Attribute might not be set when running in a multithreaded application?
Here is a snipet from the SQL log when ODBC tracing is turned on....
CourionService c3:116 ENTER SQLAllocConnect
HENV 0x009c11a0 HDBC * 0x0d53fd94
CourionService c3:116 EXIT SQLAllocConnect with return code 0
(SQL_SUCCESS)
HENV 0x009c11a0 HDBC * 0x0d53fd94 ( 0x009c17c0) CourionService c3:116 ENTER SQLSetConnectOption HDBC 0x009c17c0 UWORD 103 <SQL_LOGIN_TIMEOUT> UDWORD 15
CourionService c3:116 EXIT SQLSetConnectOption with return code 0
(SQL_SUCCESS)
HDBC 0x009c17c0 UWORD 103 <SQL_LOGIN_TIMEOUT> UDWORD 15 CourionService c3:116 ENTER SQLSetConnectOption HDBC 0x009c17c0 UWORD 101 <SQL_ACCESS_MODE> UDWORD 1
CourionService c3:116 EXIT SQLSetConnectOption with return code 0
(SQL_SUCCESS)
HDBC 0x009c17c0 UWORD 101 <SQL_ACCESS_MODE> UDWORD 1 CourionService c3:116 ENTER SQLDriverConnectW HDBC 0x009c17c0 HWND 0x00140b8c WCHAR * 0x1f4be068 [ -3] "******\ 0" SWORD -3 WCHAR * 0x1f4be068 SWORD 8 SWORD * 0x00000000 UWORD 0 <SQL_DRIVER_NOPROMPT>
CourionService c3:116 EXIT SQLDriverConnectW with return code -1
(SQL_ERROR)
HDBC 0x009c17c0 HWND 0x00140b8c WCHAR * 0x1f4be068 [ -3] "******\ 0" SWORD -3 WCHAR * 0x1f4be068 SWORD 8 SWORD * 0x00000000 UWORD 0 <SQL_DRIVER_NOPROMPT>
DIAG [08004] [Oracle][ODBC][Ora]Server rejected the connection.
(12154)
DIAG [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed (0)
CourionService c3:116 ENTER SQLErrorW
HENV 0x009c11a0 HDBC 0x009c17c0 HSTMT 0x00000000 WCHAR * 0x0d53f6e8 (NYI) SDWORD * 0x0d53f974 WCHAR * 0x0d53f2e8 SWORD 511 SWORD * 0x0d53f97e
CourionService c3:116 EXIT SQLErrorW with return code 0 (SQL_SUCCESS)
HENV 0x009c11a0 HDBC 0x009c17c0 HSTMT 0x00000000 WCHAR * 0x0d53f6e8 (NYI) SDWORD * 0x0d53f974 (12154) WCHAR * 0x0d53f2e8 [ 50] "[Oracle][ODBC][Ora]Server" SWORD 511 SWORD * 0x0d53f97e (50) CourionService c3:116 ENTER SQLErrorW HENV 0x009c11a0 HDBC 0x009c17c0 HSTMT 0x00000000 WCHAR * 0x0d53f6e8 (NYI) SDWORD * 0x0d53f974 WCHAR * 0x0d53f2e8 SWORD 511 SWORD * 0x0d53f97e
CourionService c3:116 EXIT SQLErrorW with return code 0 (SQL_SUCCESS)
HENV 0x009c11a0 HDBC 0x009c17c0 HSTMT 0x00000000 WCHAR * 0x0d53f6e8 (NYI) SDWORD * 0x0d53f974 (0) WCHAR * 0x0d53f2e8 [ 66] "[Microsoft][ODBC Driver Manager] " SWORD 511 SWORD * 0x0d53f97e (66) CourionService c3:116 ENTER SQLErrorW HENV 0x009c11a0 HDBC 0x009c17c0 HSTMT 0x00000000 WCHAR * 0x0d53f6e8 (NYI) SDWORD * 0x0d53f974 WCHAR * 0x0d53f2e8 SWORD 511 SWORD * 0x0d53f97e
CourionService c3:116 EXIT SQLErrorW with return code 100
(SQL_NO_DATA_FOUND)
HENV 0x009c11a0 HDBC 0x009c17c0 HSTMT 0x00000000 WCHAR * 0x0d53f6e8 (NYI) SDWORD * 0x0d53f974 WCHAR * 0x0d53f2e8 SWORD 511 SWORD * 0x0d53f97e CourionService c3:116 ENTER SQLDisconnect HDBC 0x009c17c0
CourionService c3:116 EXIT SQLDisconnect with return code -1
(SQL_ERROR)
HDBC 0x009c17c0
DIAG [08003] [Microsoft][ODBC Driver Manager] Connection not open (0)
CourionService c3:116 ENTER SQLFreeConnect
HDBC 0x009c17c0
CourionService c3:116 EXIT SQLFreeConnect with return code 0
(SQL_SUCCESS)
HDBC 0x009c17c0Received on Wed Jun 30 1999 - 20:12:53 CEST