multi-threading and direct mode
Posted: Thu 20 Oct 2011 15:30
Hi!
We have multi-threading service application working with Oracle Database 11g. To provide access to database we use ODAC 6.90.0.57. We've chosen DirectMode connection for easy settings and faster work.
Each thread creates a separate session. After some time (2..8 hours) of uninterruped work a few threads hang (exceptions do not occure and threads do not go further).
Threads use one of the next ODAC-objects: TOraQuery, TOraStoredProcedure.
Studying of call stack shows that threads hang when one of the threads is calling OraSession destructor and another thread is calling OraQuery Execute method or OraQuery destructor (or OraStoredProc Execute method or OraStoredProc destructor or another OraSession destructor) in the same time.
For pure experiment we've rebuilt our application with ODAC 8.0.2 and the situation happend again. Could you help me to find a solution of the trouble or at least explain the reason of such behavior?
Thread Call Stack.
first thread:
We have multi-threading service application working with Oracle Database 11g. To provide access to database we use ODAC 6.90.0.57. We've chosen DirectMode connection for easy settings and faster work.
Each thread creates a separate session. After some time (2..8 hours) of uninterruped work a few threads hang (exceptions do not occure and threads do not go further).
Threads use one of the next ODAC-objects: TOraQuery, TOraStoredProcedure.
Studying of call stack shows that threads hang when one of the threads is calling OraSession destructor and another thread is calling OraQuery Execute method or OraQuery destructor (or OraStoredProc Execute method or OraStoredProc destructor or another OraSession destructor) in the same time.
For pure experiment we've rebuilt our application with ODAC 8.0.2 and the situation happend again. Could you help me to find a solution of the trouble or at least explain the reason of such behavior?
Thread Call Stack.
first thread:
second thread::7c90e514 ntdll.KiFastSystemCallRet
:7c90df5a ntdll.NtWaitForSingleObject + 0xc
:7c901046 ntdll.RtlEnterCriticalSection + 0x46
:005b35ff ; C:\WINDOWS\system32\odac140.bpl
:005b3e42 ; C:\WINDOWS\system32\odac140.bpl
:005b3eef ; C:\WINDOWS\system32\odac140.bpl
:005b3fd1 ; C:\WINDOWS\system32\odac140.bpl
:005b41a9 ; C:\WINDOWS\system32\odac140.bpl
:005b4498 ; C:\WINDOWS\system32\odac140.bpl
:005b4828 ; C:\WINDOWS\system32\odac140.bpl
:005b8032 ; C:\WINDOWS\system32\odac140.bpl
:005bb952 ; C:\WINDOWS\system32\odac140.bpl
:005b7e45 ; C:\WINDOWS\system32\odac140.bpl
:50009d73 rtl140.@System@TObject@Free$qqrv + 0xb
:005e43a6 odac140.@Oraclasses@TOraCursor@FreeCursor$qqrv + 0xa6
:005efd8e odac140.@Oraclasses@TOCICommand@Finish$qqrv + 0xee
:005f5a0e odac140.@Oraclasses@TOCIRecordSet@InternalUnPrepare$qqrv + 0x9a
:005f5bd1 ; C:\WINDOWS\system32\odac140.bpl
:006d609d dac140.@Memdata@TData@Close$qqrv + 0x29
:007323fd dac140.@Craccess@TCRRecordSet@Close$qqrv + 0x5
:50690e08 dbrtl140.@Db@TDataSet@CloseCursor$qqrv + 0x40
:007112e4 dac140.@Dbaccess@TCustomDADataSet@CloseCursor$qqrv + 0x4c
:50690cd1 dbrtl140.@Db@TDataSet@SetActive$qqro + 0xad
:00710faa dac140.@Dbaccess@TCustomDADataSet@SetActive$qqro + 0x42
:00432947 std::auto_ptr::~auto_ptr(this=:026FF7F8) - Deleting OraQuery
:00445F1A TTerminalDataSender::GetCouponsFileName(this=:00F26420, a_session=:00EAFE30)
:0044BBA9 TTerminalDataSender::Export(this=:00F26420, a_session=:00EAFE30)
:00489876 TBaseTask::DoExecute(this=:00F26420, a_session=:00EAFE30)
:0048AFBC TBaseTask::Execute(this=:00F26420)
:0048937A TTaskStarter::Execute(this=:00F45220)
:004BDB79 __linkproc__ HookedThreadExecute(Thread=:00F45220)
:50073729 ; C:\WINDOWS\system32\rtl140.bpl
:5000b94e rtl140.@System@@Assert$qqrx20System@UnicodeStringt1i + 0x4a
:7c80b729 ; C:\WINDOWS\system32\kernel32.dll
:7c90e514 ntdll.KiFastSystemCallRet
:7c90df5a ntdll.NtWaitForSingleObject + 0xc
:71a357c9 ; C:\WINDOWS\system32\mswsock.dll
:71a94d16 ws2_32.WSARecv + 0x61
:71ab2ea3 wsock32.recv + 0x33
:500aa123 rtl140.@Scktcomp@TCustomWinSocket@ReceiveBuf$qqrpvi + 0xaf
:005b3631 ; C:\WINDOWS\system32\odac140.bpl
:005b3e85 ; C:\WINDOWS\system32\odac140.bpl
:005b3f16 ; C:\WINDOWS\system32\odac140.bpl
:005b41b6 ; C:\WINDOWS\system32\odac140.bpl
:005b4498 ; C:\WINDOWS\system32\odac140.bpl
:005b4828 ; C:\WINDOWS\system32\odac140.bpl
:005b7152 ; C:\WINDOWS\system32\odac140.bpl
:005b7859 ; C:\WINDOWS\system32\odac140.bpl
:005c0a97 ; C:\WINDOWS\system32\odac140.bpl
:005df89b ; C:\WINDOWS\system32\odac140.bpl
:0070bef9 dac140.@Dbaccess@TCustomDAConnection@DoDisconnect$qqrv + 0x89
:00622841 odac140.@Ora@TOraSession@DoDisconnect$qqrv + 0x39
:5067f0d9 dbrtl140.@Db@TCustomConnection@SetConnected$qqro + 0x75
:00623bb5 odac140.@Ora@TOraSession@SetConnected$qqro + 0x49
:0070c0ef dac140.@Dbaccess@TCustomDAConnection@Disconnect$qqrv + 0x7
:00621999 odac140.@Ora@TOraSession@$bdtr$qqrv + 0xa1
:00429027 std::default_delete::operator ()(this=:021FFE88, _Ptr=:00EAEA30) - Deleting OraSession
:00428FD5 std::unique_ptr >::_Delete(this=:021FFE88)
:00428D05 std::unique_ptr >::~unique_ptr >(this=:021FFE88)
:0048B12F TBaseTask::Execute(this=:00FB8DF0)
:0048937A TTaskStarter::Execute(this=:00F44D20)
:004BDB79 __linkproc__ HookedThreadExecute(Thread=:00F44D20)
:50073729 ; C:\WINDOWS\system32\rtl140.bpl
:5000b94e rtl140.@System@@Assert$qqrx20System@UnicodeStringt1i + 0x4a
:7c80b729 ; C:\WINDOWS\system32\kernel32.dll