Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Problem with handle leaks...?!
> Possibly the connection can take more than the 2500 ms you wait for
> between creating different threads? Then with the database code in
> there you can get many threads running at a time, whereas without it
> you only have 1 or 2 threads.
Well, after all this is a test program only. (In the "real" application
there
is no Sleep() command. Instead the number of parallel running threads
is limited to 10.) The 2500 ms delay is long enough for the db commands
to execute (it takes some 800 ms for the thread to complete).
The (test-)program's output on the console is:
0
Open... Close...
1
Open... Close...
2
Open... Close...
3
Open... Close...
. . .
> How about using just one thread in the test program?
If using only one thread (i. e. not using AfxBeginThread) then the handle leak is gone. It seems that the problem only shows up, if the db connection is created by a worker thread. But I still hope that I don't have to open all my db connections in the main thread, because this would slow down the performance of the whole application...
Thank you for the reply.
Tilman
Received on Thu Jul 31 2003 - 01:53:13 CDT
![]() |
![]() |