cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Durchholz, Joachim" <>
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/
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.

View raw message