Hello developers,

we have to store large character arrays into an oracle 9 database. However,
the oracle thin driver (even the new 9.2.0.3 Version) has a few problems
with that hinder the use of castor:

- Using CLOB fields, the clob field has to be one of the first elements of
the parameter list. If it is not, storing the value causes a Socket Read
error. Castor always sets the identity columns as first parameters. Because
of this, I could not use the CLOB type in oracle (my table has an identity
of three columns and storing an object caused the socket read error).

- Oracle provides another type called "long" for large strings (I know it
will be gone in Oracle 10). Using this type, no socket read error occurs.
However, the castor framework sets strings (in class SQLTypes) always with
setObject. And the Oracle thin driver accepts only strings of 4000
characters or less using setObject. Longer Strings have to be provided using
a stream. I had to patch the setObject method in the SQLTypes class by
inserting the following switch-clause:

            case Types.CHAR:
                  String stringValue = (String) value;
                  if (stringValue.length() > 3900) {
                      StringReader reader = new StringReader(stringValue);
 
stmt.setCharacterStream(index,reader,stringValue.length());

                  } else {
                      stmt.setObject(index, value, sqlType);
                  }
                  break;

My questions are:

- Is there a way to change the order of the parameter list in the set method
(keys not in front) ?
- Will you insert the patch into the next release so the problem is fixed?


Best regards,

     Christian Hinken.

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to