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: DBMS_LOB question - LOADFROMFILE problem

Re: DBMS_LOB question - LOADFROMFILE problem

From: Paul Brewer <paul_at_paul.brewers.org.uk>
Date: Thu, 29 May 2003 21:03:47 +0100
Message-ID: <3ed677d3$1_3@mk-nntp-1.news.uk.worldonline.com>


"Scott Mattes" <Scott_at_TheMattesFamily.ws> wrote in message news:lWpBa.1119$cp6.853031_at_news1.news.adelphia.net...
> You might also be able to bounce Oracle to free the file.
>
>
> "Daniel Morgan" <damorgan_at_exxesolutions.com> wrote in message
> news:3ED6252F.11000072_at_exxesolutions.com...
> > David wrote:
> >
> > > Hi, I have been using DBMS_LOB to load files from a native file system
> > > into an Oracle 8.1.7.0.0 database. An excerpt of the code I have used
> > > is below (the line numbers are for reference only):
> > >
> > > 1. DBMS_LOB.FILEOPEN(l_BFILE);
> > > 2. DBMS_LOB.LOADFROMFILE(l_CLOB,l_BFILE,500);
> > > 3. DBMS_LOB.CLOSEFILE(l_BFILE);
> > >
> > > An exception on line 2. was thrown and the file was never closed, that
> > > is line 3 never executed. Now when I try to delete the file in the
> > > underlying file system is says (Win2K) "Cannot delete xxxx.txt: There
> > > has been a sharing violation".
> > >
> > > I've fixed the problem in the code so that when exceptions are raised,
> > > the file will be closed from now on. But I am not sure now how to get
> > > Oracle to close the file it holding onto (other than taking down the
> > > database/server which isn't an option).
> > >
> > > Hmmm. Ideas anyone?
> > >
> > > Thank you
> > > David
> >
> > Reboot the machine. That is the universal solution for all Microsoft
> > product problems: This one too.
> >
> > --
> > Daniel Morgan
> > http://www.outreach.washington.edu/extinfo/certprog/oad/oad_crs.asp
> > damorgan_at_x.washington.edu
> > (replace 'x' with a 'u' to reply)
> >
> >
>

Maybe I'm missing something, but why not just trap and log the error on line 2, so that the file gets closed anyway?

Regards,
Paul Received on Thu May 29 2003 - 15:03:47 CDT

Original text of this message

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