oracle11gtemporaryoracle11gr2lob

Oracle 11g temporary lob not freeable


I´m using Oracle 11gR2, can someone tell me why the temporary lob isn´t freed?

    ... 
    -- Apply stylesheet to DOM document
    outdomdocf := dbms_xslprocessor.processxsl(proc, xsl, indomdoc);
    outnode := dbms_xmldom.makenode(outdomdocf);

    -- Write the transformed output to the CLOB
    dbms_lob.createTemporary(outfile, true, DBMS_LOB.CALL);
    dbms_xmldom.writetoCLOB(outnode, outfile);

    -- Free Cursors
    outXML := XMLTYPE.createXml(outfile);
    dbms_lob.freeTemporary(outfile);            <-- not working
    ...

When I do

select * from v$temporary_lobs;

It´s still there.


Solution

  • you need DBMS_LOB.CLOSE() to close it before calling DBMS_LOB.FREETEMPORARY() .