1 Reply Latest reply on Mar 25, 2013 2:16 PM by mdrake-Oracle

    "Dead" XMLDocument objects


      I am using JDBC to retrieve a XMLDocument from a table with an XMLType in it like this:
      ResultSet res...
      SQLXML sqlxml = res.getSQLXML(13);
      src = sqlxml.getSource(DOMSource.class);
      XMLDocument doc= (XMLDocument)src.getNode();
      The problem is, after the "close()" call on the connection, the XMLDocument is no longer valid - it's a "dead" XMLType, and any attempts to read or update that document results in this exception:
      java.sql.SQLRecoverableException: Closed Connection
      My question is, other than copying the whole document via a java.xml.Transformer (which is very expensive), is there any way to prevent this behavior?

      I apologize if this has been asked before..
        • 1. Re: "Dead" XMLDocument objects
          Unfortunately not. I think you problem starts the once you close the SQLXML object. XML's are like LOBs in that they are intrinsically bound to the connection that created them, and require a connection to the database in order to function.

          Even if we did this for you it would still require that we copy the DOM.