Oracle 8.1.7 OCI question: Some threads hang in OCIServerAttach indefinetly after remote database shutdown.

From: Tomislav <shaka_at_envox.hr>
Date: Thu, 31 Jan 2002 16:17:43 +0100
Message-ID: <MRLN490410D026_at_merlin.envox.hr>



Configuration: MS Win2k SP2, MS Visual C++ 6.0 SP6, Oracle 8.1.7 via OCI

I have 128 threads doing the following:

  1. Create environment (OCI_THREADED, OCI_ENV_NO_MUTEX), setup handles, try to connect to remote database
  2. If connect fails, log the error message and try again after 2 seconds
  3. Execute simple stored procedure
  4. Disconnect from remote database ( + cleanup of all handles including environment )
  5. ... repeat from 1)

When I go to the remote database and perform shutdown of the whole operating system (by choosing shutdown in Windows), something peculiar happens. First I get:
ORA-12500 and ORA-12541 error messages. Then most of the channels go to ORA-12535 error message and they loop in that message until I exit the application. However, some of the threads remain hanging in OCIServerAttach function and do not allow my application to exit.

Needless to say, OCIBreak function doesn't help here (I've tried).

When I attach the debugger to the hanging process, I get the attached stack trace. It looks like some sockets remain hanging - a terrible thing to happen.

In the attachment are also Oracle error descriptions that I mentioned.

I would be thankful for any suggestions here...

--
Tomislav.


"Real sharpness comes without effort,
No growth without assistance, No action without reaction, Now give yourself up and find yourself again." --
"Crouching tiger, hidden dragon"
//////////////////////////////////////////////////////////////////////////// NTDLL! 77f827e8() MSAFD! 74fd8e33() WS2_32! 75031275() ORANTCP8! 6470565f() ORANTCP8! 64703536() ORAN8! 60b78f5a() ORAN8! 60b7c8a8() ORAN8! 60b44d24() ORAN8! 60b3fd0a() ORAN8! 60b3f474() ORAN8! 60b157a0() ORAN8! 60b61c7c() ORACLIENT8! 60429b1e() ORACLIENT8! 604b4695() ORACLIENT8! 604b9ece() ORACLIENT8! 604823a3() ORACLIENT8! 60429f64() ORACLIENT8! 60401340() OCI! 015059ab() CLibOCI::OCIServerAttach(OCIServer * 0x0dff13e0, OCIError * 0x0dff15d4, unsigned char * 0x0de9b810, int 21, unsigned int 0) line 282 + 28 bytes FCALLDLL! 014d2c03() MSVCRT! 7800a3c0() KERNEL32! 77e8758a() ////////////////////////////////////////////////////////////////////////////
"TNS-12500 TNS:listener failed to start a dedicated server process
Cause: The process of starting up a dedicated server process failed. The executable could not be found or the environment may be set up incorrectly. Action: Turn on tracing at the ADMIN level and re-execute the operation. Verify that the Oracle Server executable is present and has execute permissions enabled. Ensure that the Oracle environment is specified correctly in LISTENER.ORA. The Oracle Protocol Adapter that is being called may not be installed on the local hard drive. Check that the correct Protocol Adapter are successfully linked. If the error persists, contact Oracle Customer Support. TNS-12541 TNS:no listener Cause: The connection request could not be completed because the listener is not running. Action: Ensure that the supplied destination address matches one of the addresses used by the listener. Compare the TNSNAMES.ORA entry with the appropriate LISTENER.ORA file (or TNSNAV.ORA if the connection is to go by way of an Interchange). Start the listener on the remote machine. TNS-12535 TNS:operation timed out Cause: The requested connection could not be completed within the timeout period specified by the CONNECT_TIMEOUT parameter in LISTENER.ORA. This error arises from the TNSLSNR. Action: Either reconfigure CONNECT_TIMEOUT to be 0, which means wait indefinitely, or reconfigure CONNECT_TIMEOUT to be some higher value. Or, if the timeout is unacceptably long, turn on tracing for further information."
Received on Thu Jan 31 2002 - 16:17:43 CET

Original text of this message