In Jaws, JAVA_OBJECTS are written to the database using ps.setBytes.  Oracle
stipulates that with ps.setBytes a maximum of 2000 bytes can be written to
the database.  The 8.1.5 drivers did not enforce this, but the 8.1.7 drivers
do, which means that when trying to persist large objects I get "ORA-01483:
invalid length for DATE or NUMBER bind variable" (really helpful error
message :))

Anyway, the reccomended fix is to use setBinaryStream, and I implemented
this (and it works like a charm).  Has anybody put this into the 2.1 code?
It certainly is nice to have object persistence working :)


from org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.setParameter:

          if (jdbcType == Types.JAVA_OBJECT) {

             ......

             byte[] bytes = baos.toByteArray();
             stmt.setBytes(idx, bytes);
          } else {

             .......

becomes

          if (jdbcType == Types.JAVA_OBJECT) {

             ......

             byte[] bytes = baos.toByteArray();
              if (bytes.length < 2000)
                 stmt.setBytes(idx, bytes);
              else
                 stmt.setBinaryStream(idx, new ByteArrayInputStream(bytes),
bytes.length);
          } else {

             .......


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
List Help?:          [EMAIL PROTECTED]

Reply via email to