cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Durchholz, Joachim" <Joachim.Durchh...@hennig-fahrzeugteile.de>
Subject RE: Writing blobs fails
Date Tue, 03 Jul 2012 09:54:04 GMT
> 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):
> http://java.ittoolbox.com/groups/technical-functional/java-l/invalid-arguments-in-call-in-line-oraclesqlblobcreatetemporary-oracle-10g-1468092JDBC

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.

Mime
View raw message