Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: UTL_SMTP hangs while sending

Re: UTL_SMTP hangs while sending

From: Billy Verreynne <vslabs_at_onwe.co.za>
Date: 4 Aug 2003 12:01:43 -0700
Message-ID: <1a75df45.0308041101.4240b54b@posting.google.com>


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.

--
Billy
Received on Mon Aug 04 2003 - 14:01:43 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US