I've upgraded to IBDAC 3.10.0.16 from 2.5 and I've ran into a problem.
At a point where my program used to work perfectly, sometimes an "Error reading data from the connection" EIBCError is displayed.
The problem is that the error can't always be reproduced, but tests show it happens at the same place.
I've an idea on what is causing it, and I need your feedback to work something out.
The following is happening at the place of the error:
1. An INSERT INTO command is executed using IBCQuery.ExecSQL.
--- Meanwhile ---
In the database an After Insert trigger is fired, which inserts a record to a log table and fires a Firebird event.
--- Back to the program
2. After ExecSQL a RET_ paremeters are stored which were returned by the INSERT INTO - RETURNING ... query.
3. Using INSERT INTO another record is inserted to a separate table. IBCQuery.ExecSQL is called.
-----> And this is where the "Error reading data from the connection" error is raised, straight after the second ExecSQL.
Please note that in order to handle the event generated by the AFTER INSERT trigger, an IBCAlerter is used. Once the alerter receives the event, it does a query on the log table using a separate, IBCQuery2 component (IBCQuery and IBCQuery2 are using the same IBCConnection component).
Since the error happens at the same place and not always but just from time-to-time, I believe this must be an issue with the IBCAlerter component. (which is known to be a very problematic component by IBDAC customers )
Do you guys have any ideas on what might be causing the problem?
Did you change anything in how IBCAlerter works in the past few versions of IBDAC? Are alerts still executed in the main thread and what you do there is considered "thread safe"?
Here are some Eurekalog error logs:
Note: I'm using Delphi7 with FB2.1.---------------------------------------------------------------------------------------------------------
|Address |Module |Unit |Class |Procedure/Method |Line |
---------------------------------------------------------------------------------------------------------
|Running Thread: ID=1496; Priority=0; Class=; [Main] |
|-------------------------------------------------------------------------------------------------------|
|7C903247|ntdll.dll | | |RtlConvertUlongToLargeInteger| |
|78144FB0|MSVCR80.dll | | |memcpy | |
|7C90E485|ntdll.dll | | |KiUserApcDispatcher | |
I've taken out some lines here, it just shows where the error happens in my code...
|7E36BFFB|user32.dll | | |NotifyWinEvent | |
|7C90ECBA|ntdll.dll | | |RtlMultiByteToUnicodeN | |
|7C90EB94|ntdll.dll | | |RtlAnsiStringToUnicodeString | |
|7C90D328|ntdll.dll | | |ZwFindAtom | |
|7E36BD41|user32.dll | | |PtInRect | |
|7E36B8FE|user32.dll | | |SendMessageW | |
|7E36F658|user32.dll | | |CallWindowProcA | |
|7E36F642|user32.dll | | |CallWindowProcA | |
|7C802540|kernel32.dll| | |WaitForSingleObjectEx | |
|7C80252D|kernel32.dll| | |WaitForSingleObject | |
|7C90DA28|ntdll.dll | | |NtReleaseMutant | |
|7C8024B1|kernel32.dll| | |ReleaseMutex | |
|7E37E0C9|user32.dll | | |PostThreadMessageW | |
|7C9010E0|ntdll.dll | | |RtlLeaveCriticalSection | |
|7E3694DA|user32.dll | | |GetCapture | |
|7E36F891|user32.dll | | |CallNextHookEx | |
|7E3696C2|user32.dll | | |DispatchMessageA | |
|7E3696B8|user32.dll | | |DispatchMessageA | |
|-------------------------------------------------------------------------------------------------------|
| |
|Running Thread: ID=1748; Priority=0; Class=TWorkerThread |
|-------------------------------------------------------------------------------------------------------|
|7E37F3C7|user32.dll | | |SendMessageA | |
|7E37F383|user32.dll | | |SendMessageA | |
|0053C9AA|Program.exe|VirtualTrees.pas|TWorkerThread |ChangeTreeStates |5194[2] |
|0053C970|Program.exe|VirtualTrees.pas|TWorkerThread |ChangeTreeStates |5192[0] |
|0053CACD|Program.exe|VirtualTrees.pas|TWorkerThread |Execute |5244[37] |
|-------------------------------------------------------------------------------------------------------|
|Calling Thread: ID=1496; Priority=0; Class=; [Main] |
|-------------------------------------------------------------------------------------------------------|
|0053C927|Program.exe|VirtualTrees.pas|TWorkerThread |Create |5174[2] |
|0053C8F4|Program.exe|VirtualTrees.pas|TWorkerThread |Create |5172[0] |
|0053C885|Program.exe|VirtualTrees.pas| |AddThreadReference |5125[9] |
|0053C850|Program.exe|VirtualTrees.pas| |AddThreadReference |5116[0] |
|0054625E|Program.exe|VirtualTrees.pas|TBaseVirtualTree |Create |11644[87]|
|00545F94|Program.exe|VirtualTrees.pas|TBaseVirtualTree |Create |11557[0] |
|0055FA15|Program.exe|VirtualTrees.pas|TCustomVirtualStringTree|Create |29621[1] |
|-------------------------------------------------------------------------------------------------------|
| |
|Running Thread: ID=2304; Priority=0; Class=TGDSAlerterThread |
|-------------------------------------------------------------------------------------------------------|
|7C90DF58|ntdll.dll | | |ZwWaitForSingleObject | |
|7C802540|kernel32.dll| | |WaitForSingleObjectEx | |
|7C80252D|kernel32.dll| | |WaitForSingleObject | |
|7C802520|kernel32.dll| | |WaitForSingleObject | |
|02DBBA5D|fbclient.dll| | |gds__alloc | |
|-------------------------------------------------------------------------------------------------------|
|Calling Thread: ID=1496; Priority=0; Class=; [Main] |
|-------------------------------------------------------------------------------------------------------|
|7C9010E0|ntdll.dll | | |RtlLeaveCriticalSection | |
|7E36CEA6|user32.dll | | |MonitorFromWindow | |
|-------------------------------------------------------------------------------------------------------|
| |
|Running Thread: ID=1380; Priority=0; Class=TGDSAlerterThread |
|-------------------------------------------------------------------------------------------------------|
|7C90DF58|ntdll.dll | | |ZwWaitForSingleObject | |
|7C802540|kernel32.dll| | |WaitForSingleObjectEx | |
|7C80252D|kernel32.dll| | |WaitForSingleObject | |
|7C802520|kernel32.dll| | |WaitForSingleObject | |
|02DBBA5D|fbclient.dll| | |gds__alloc | |
|-------------------------------------------------------------------------------------------------------|
|Calling Thread: ID=1496; Priority=0; Class=; [Main] |
|-------------------------------------------------------------------------------------------------------|
|7C9010E0|ntdll.dll | | |RtlLeaveCriticalSection | |
|7E36CEA6|user32.dll | | |MonitorFromWindow | |
|-------------------------------------------------------------------------------------------------------|
| |
|Running Thread: ID=2196; Priority=0; Class=TGDSAlerterThread |
|-------------------------------------------------------------------------------------------------------|
|7C90DF58|ntdll.dll | | |ZwWaitForSingleObject | |
|7C802540|kernel32.dll| | |WaitForSingleObjectEx | |
|7C80252D|kernel32.dll| | |WaitForSingleObject | |
|7C802520|kernel32.dll| | |WaitForSingleObject | |
|02DBBA5D|fbclient.dll| | |gds__alloc | |
|-------------------------------------------------------------------------------------------------------|
|Calling Thread: ID=1496; Priority=0; Class=; [Main] |
|-------------------------------------------------------------------------------------------------------|
|7C9010E0|ntdll.dll | | |RtlLeaveCriticalSection | |
|7E36CEA6|user32.dll | | |MonitorFromWindow | |
|-------------------------------------------------------------------------------------------------------|
| |
|Running Thread: ID=1780; Priority=0; Class=TGDSAlerterThread |
|-------------------------------------------------------------------------------------------------------|
|7C90DF58|ntdll.dll | | |ZwWaitForSingleObject | |
|78144FB0|MSVCR80.dll | | |memcpy | |
|02DC55BD|fbclient.dll| | |isc_event_counts | |
|7C802540|kernel32.dll| | |WaitForSingleObjectEx | |
|7C80252D|kernel32.dll| | |WaitForSingleObject | |
|7C802520|kernel32.dll| | |WaitForSingleObject | |
|02DBBA5D|fbclient.dll| | |gds__alloc | |
|-------------------------------------------------------------------------------------------------------|
|Calling Thread: ID=1496; Priority=0; Class=; [Main] |
|-------------------------------------------------------------------------------------------------------|
|7C9010E0|ntdll.dll | | |RtlLeaveCriticalSection | |
|7E36CEA6|user32.dll | | |MonitorFromWindow | |
---------------------------------------------------------------------------------------------------------
Thanks!