Jeremy Boynes wrote:
Stefan Schmidt wrote:
Gianny, Jeremy,
I got it! Apparently, the problem was on my site. I actually loaded
the Blobs (images) directly via the PhpMyAdmin Gui (there is a file
upload function) and then tried to access these blob fields via the
EJB. To dig into my problem I tried the
org.openejb.test.entity.cmp2.StorageTests on MySQL and this worked. So
I ended up updating my blob fields via the EJB (loading the files via
the EJB rather than PhpMyAdmin ) and now it works! Seems like the
PhpMyAdmin does something with the blob that Java doesn't like...
I think its the other way around - I am guessing that PhpMyAdmin is
inserting the bytes directly but when you use the EJB it is Serializing
the array and writing the serialized data stream.
When the EJB tries to read the bytes inserted by PhpMyAdmin it gets the
raw data rather than the bytes for ObjectInputStream and is raising an
error.
I think this is a bug as we should be able to support the raw data
format correctly - we need to play nice with other applications.
I updated the OpenEJB itest to check that the data stored in the column
was what was being passed to the accessor i.e. that is it not bing
Serialized. I added a new binding to TranQL (1.1-SNAPSHOT) to make this
test work so I think you will now be able to mix access between your
admin tool and the EJB.
This will require an update to use OpenEJB HEAD (2.0-SNAPSHOT) and
TranQL HEAD (1.1-SNAPSHOT)
--
Jeremy