Has this problem been fixed in 3.1B1?I don't think so. The relevant line from the stack trace is line 255 in java/org/apache/cayenne/dba/oracle/OracleLOBBatchAction.java.
On trunk in /trunk/framework/cayenne-jdk1.5-unpublished/src/main/ , this line reads:
OutputStream out = blob.setBinaryStream(0);
Offsets in JDBC generally start at 1, not zero, and the JDBC specs on Blob#setBinaryStream are no exception, so this should be
OutputStream out = blob.setBinaryStream(1);
And one that describes what's happening (not Cayenne specific):The salient point is in the last answer, by Ale Gonzalez: Don't use 0 on setBinaryStream.
Actually, it's even documented in the Javadoc for #setBinaryStream.
(Somebody deserves to roast somewhere unpleasant for having JDBC use 1 and the rest of the JDK use 0. It's a first-rate source of bugs.)
Or is our only option to find and use an older Oracle JDBC adapter.If you can work from the Cayenne sources, you might want to consider applying that one-line fix to the sources until upstream gets around to fixing this.