Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: UTL_SMTP hangs while sending
md_at_burning.de (Marc) wrote
> We are using Oracle 8.1.7.4.2.
<snipped>
> we got the following problem:
> It may happen, that the vpn-connection between database server and
> mail-server wents down for a second, while a job is sending (using
> utl_smtp.write_text). If this happens, the job "hangs" - control is
> not given back.
<snipped>
Seeing that we do not have the UTL_SMTP source... Marc, this sounds like a blocking call problem.. which is likely how UTL_SMTP is implemented?
And yes, Oracle will not raise an exception as there is nothing to raise. The IP stack has the execution pointer and it is stuck. While Oracle waits for blocking call to complete.
I hate blocking calls in sockets programming. It is a pain as you release control of a call to the IP stack. For example, you do a send() and send the RCPT TO data. Next you do a recv() to get the ack from the SMTP server. Only, something goes wrong and there is nothing to recv().. ever.. until something gets killed or kicked.
UTL_TCP itself can be used without having to run into such a blocking call problem (e.g. you check if there's data in the recv() buffer before doing a recv() and reading the exact number of bytes in the buffer).
Anyway IMO, if UTL_SMTP has been implemented using "default blocking" calls, there is _nothing_ you can do to fix it... but to rewrite it.
-- BillyReceived on Mon Aug 04 2003 - 14:01:43 CDT