Well...
Adding CLOB support turned out to be much more complicated than I
thought. I'm not sure how much of my problems are due to the fact
thatI'm using Oracle vs. some other db but:
1) I was under the impression that I could just use my own Clob
implementation and call PreparedStatement.setClob. Unfortunately, this
is not the case. Oracle JDBC will throw a ClassCastException if it
doesn't get an oracle.sql.CLOB. Furthermore, to save a CLOB for the
first time, the row needs to be created first, then you need to select
the Clob object, and then finally you can write the data out to the db.
This means that CLOB support is not going to be as simple as providing
a ClobType.
2) In order to write to a Clob, it must first be retrieved with a SELECT
... FOR UPDATE statement, which means that we'd have to fool around with
locking when writing Clobs.
3) I considered just using character streams, but then found that Oracle
does not support this with their thin JDBC drivers. They have a nice
warning about data corruption if you don't use their OCI driver instead.
The above applies to BLOBs as well. I think I'm giving up on this for
now, unless anyone has an idea about how to get around these problems.
-Mark
|