I have a table which has a field which "succeeds" trying to save a byte
array, say around 170,000 bytes, but when I look later, only some 40,000 or
so bytes are in the field.  The field is defined as a LONGVARBINARY, which
in Oracle becomes a "LONG RAW" type.  I don't see why the row wouldn't be
saved completely...  If I save a smaller byte array, say 10,000, it works
fine.

Also, I tried changing the type to "BLOB", and rebuilding.  When I do this,
my code produces this Oracle error:

ORA-01461 can bind a LONG value only for insert into a LONG column
    Cause: An attempt was made to insert a value 
    from a LONG datatype into another datatype. This is not allowed.
    Action: Do not try to insert LONG datatypes into other types of columns.

I pass the blob in to the generated torque code as a byte array, which is
the same for BLOB or LONG RAW.  I've tried saving with the generated
setDataBlob() method and using the criteria.add(TableWhateverPeer.DATABLOB,
bytes) and both produce the same error.  (My data will not be larger than
2G, so I don't mind using BLOB or LONGRAW, whichever works...)

I saw John McNally's post this summer saying that BaseValueParser does not
support setting the byte[] type of attribute, but I don't really understand
his suggested solution, which has to do with renaming a "fileupload key",
extracting the byte[] and setting it yourself...  Any further hints?

Thanks,
Dan

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to