Hmm solved the problem very quickly.
The explanantion
The field was defined in jaws:
<entity>
<ejb-name>PictureBean</ejb-name>
<cmp-field>
<field-name>fileByteArray</field-name>
<jdbc-type>JAVA_OBJECT</jdbc-type>
<sql-type>LONGBLOB</sql-type>
</cmp-field>
</entity>
The byte[] was casted to Object to be stored in the BLOB field, but when
stored with the JAVA_OBJECT jdbc-type the Object got prefixed with rmi
code.
Replacing the jaws mapping to:
<entity>
<ejb-name>PictureBean</ejb-name>
<cmp-field>
<field-name>fileByteArray</field-name>
<jdbc-type>LONGVARBINARY</jdbc-type>
<sql-type>LONGBLOB</sql-type>
</cmp-field>
</entity>
Solved the problem
Greetins Ralph
On 01/31/2001 08:28:37 AM jboss-user wrote:
> Hi Bjarne,
>
> Now I have a problem with MySQL and the BLOB field. I streamed a file to
a
> bytearray (byte[]) en defined a BLOB field for that. Until the bean is
> passivated all thing go right and the byte[] can be streamed back to a
> copy of the original file. but when the file has to be loaded from the
> database the byte array gets corrupted and can't be used to copy the
> original file.
>
> I looked into the problem and found that the following code is added in
> the front of the array:
> objBytesq ~ xp±Ï×pur [B¬óøTà xp ¬í ur [B¬óøTà
xp ö
>
>
> Can anyone explain this and when explained give me a solution?
>
> Greetz Ralph
>
>
> On 01/30/2001 09:50:36 AM jboss-user wrote:
>
> > Hello Per!
> >
> > Thanks for your help. I've fixed my problem. It was my failure. I
stared
> at
> > my deployment descriptor, compared it with your snippet and this
morning
> I
> > saw that I put BLOB into the jdbc-type directive and vice versa.
> >
> > Thank you a lot.
> > Bjarne
>
>
> --
> --------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> List Help?: [EMAIL PROTECTED]
>
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
List Help?: [EMAIL PROTECTED]