I'm using TOracleQuery in an interent server application.
To receive Messages from a socket, I'm using overlapping WSARecv with a completion-routine and waiting in an alertable WSAWaitForMultipleEvents.
When a Message comes in, I use 1 non-threaded OracleQuery to write data to DB. While the query executes, my WSARecv completion-routine fires again (?!) instead of waiting for termination of the oraclequery.execute statement.
When running again into the execute while the first execute is still in progress, my app gets the "game over"...
To prevent this effect, I changed execution mode to threaded and wait (unalertable) directly after the execute statement for an event that is set in the OnThreadFinished-Event (and then - for safety - sleeping another turn: "while ThreadIsRunning")
...
There must be a better way?! ;-)
Thanks,
Frank
To receive Messages from a socket, I'm using overlapping WSARecv with a completion-routine and waiting in an alertable WSAWaitForMultipleEvents.
When a Message comes in, I use 1 non-threaded OracleQuery to write data to DB. While the query executes, my WSARecv completion-routine fires again (?!) instead of waiting for termination of the oraclequery.execute statement.
When running again into the execute while the first execute is still in progress, my app gets the "game over"...
To prevent this effect, I changed execution mode to threaded and wait (unalertable) directly after the execute statement for an event that is set in the OnThreadFinished-Event (and then - for safety - sleeping another turn: "while ThreadIsRunning")
...
There must be a better way?! ;-)
Thanks,
Frank