2 Replies Latest reply: Apr 26, 2007 3:53 AM by 499858 RSS

    Unable to save blobs on OAS 9.0.4

    499858
      Production system (Solaris):
      Database: 10.2.0.2
      OAS: 9.0.4.1

      Test system (Windows 2003)
      DB 10.2.0.2
      OAS 10.1.2.0.2

      Our java application saves xml-files to blob-columns in the database.
      Here a code snippet:

      String sql = "INSERT INTO xml_table (xml_content, xml_name) VALUES (?, ?)";
      PreparedStatement ps = conn_.prepareStatement(sql);
      ps.setBinaryStream(1, this.getXmlContent().getInputStream(), (int) this.getXmlContent().getSize());
      ps.setString(2, this.getXmlName());
      ps.execute();

      This works fine on the test system,
      but on the production system it results in an error like this:

      java.sql.SQLException: ORA-01460: unimplemented or unreasonable conversion
      requested

      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:189)
      at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:242)
      at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:554)
      at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1478)
      at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:888)
      at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2076
      )
      at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1986)
      at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java
      :2697)
      at
      oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedState
      ment.java:457)
      at
      oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.j
      ava:531)
      ....

      We tried to get OAS 9.0.4 for our test system, but it doesn't seem to be available anywhere.
      Upgrading the production system is NOT an option.

      Any ideas?
        • 1. Re: Unable to save blobs on OAS 9.0.4
          520391
          Hi,

          We used this construction:

          insert into table (id, blob_content) values (?, empty_blob());
          and
          select id, blob_content from table where id = ? for update;

          and:
          Blob blob = resultSerOfSelectAbove.getBlob(2);
          OutputStream blobOs = blob.setBinaryStream(0);
          byte[] buffer = <the XML file content>;
          if ( (blobOs != null) && (buffer != null) ) {
          blobOs.write(buffer);
          blobOs.close();
          }

          It worked on Oracle DB 8i (AIX) and OAS 10g (Red Hat).

          Regards,
          Kati
          • 2. Re: Unable to save blobs on OAS 9.0.4
            499858
            Thanks for your reply,

            we found that the cause for this problem is the JDBC-driver of the AS.

            OAS 9.0.4 contains the JDBC driver 9.0.1, which is really buggy on BLOB-handling - we can reproduce the error on other systems by using this driver within the application.

            So we have to convince the customer that an upgrade is absolutely necessary or he needs an additional server.

            Thanks for trying, please consider this case as closed.