Returning an object type that contains a blob from an Oracle Server Function written in Java

From: CyclingGuy <ericdavies_at_netzero.net>
Date: Wed, 28 May 2008 14:11:05 -0700 (PDT)
Message-ID: <98c64c67-669c-4d0d-a7f7-a00d445c1fa2@y22g2000prd.googlegroups.com>


I've written a pair of table returning functions, implemented in Java using the ODCITable Interface.

One function returns rows containing objects that contain simple primitive data types (an integer and a double precision). This function works as designed.

The other function returns rows containing objects that contain a blob. This function seems to be affected by the size of the returned blob. If the blob is < 5 bytes long, the function succeeds though the output is strange. If the blob is 5 bytes long, it generates the following error:

      ORA-22275: invalid LOB locator specified If the blob is > 5 bytes long, it generates the following error:

      ORA-00600: internal error code, arguments: [kollasg:client-side tmp lob], [], [], [], [], [], [], []

The object being returned is being created by the following java fragment:

    StructDescriptor outDesc =
      StructDescriptor.createDescriptor("POINT_CONTAINER", conn);     Object[] out_attr = new Object[1];

    StructDescriptor recordDesc =
      StructDescriptor.createDescriptor("POINT", conn);     Object[] record_attr = new Object[2];

      oracle.sql.BLOB blob = oracle.sql.BLOB.createTemporary(conn, true,

            oracle.sql.BLOB.DURATION_SESSION);
      byte [] bytes = new byte[desiredBlobSize];
      for(int i = 0; i < bytes.length; i++ ) {
          bytes[i] = (byte)((i%3)+54);
      }
      blob.setBytes( bytes);

      record_attr[0] = blob;
      record_attr[1] = new Double( nrowsval);
      out_attr[0] = new STRUCT( recordDesc, conn, record_attr);

      ... = new STRUCT(outDesc, conn, out_attr));

I'm running Oracle 11g on a Fedora Core 7 box.

Can anyone offer any ideas? Is this a known Oracle bug? I can provide the complete source code and sql to any interested parties (I've pruned the original down to just the logic relevent to this problem).

Thanks in advance,
Eric. Received on Wed May 28 2008 - 16:11:05 CDT

Original text of this message