didn't catch the first time around

-----Original Message-----
From: The elephantwalker [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 21, 2001 1:32 AM
To: Orion-Interest
Subject: RE: CMP and BLOB fields


Juan,

If you make your cmp field a byte[], the type in Oracle will be BLOB in
version 1.5.0 and above. You are almost there, however, BLOB's are not
stored in the same way as other fields, and are therefore limited to 4k in
Oracle with a Thin Driver.

There is a way, however, to use BLOB's in a cmp, and within the spec. We do
this on our web site, www.elephantwalker.com. Users can attach up to 4 MB of
files to the message board at a time, and all of these are stored with a
cmp/ejb.

How do we do it?

The cmp has the standard fields for a file: mime-type, size, name, creation
date, modified date (and whatever else you want). We have business methods
in the cmp which are setAttachment, getAttachment. Within the business
method, a stateless session bean is used to put the byte[] in and out of the
ejb. The stateless session bean does the down and dirty with jdbc to break
the 4k barrier for the BLOB. On remove, the slsb also removes the BLOB.

The disadvantage is we have to limit the size of any one file, for memory
reasons. But you could easily chunk up the byte[] to get around this
problem.

We will be putting this up on our tips page soon, but until then, you can
take a peak at the CLOB version of the stateless session bean at
www.elephantwalker.com/rfa?id=86, the BLOB version is very similar. You will
have to join, to look at this, but its free.

regards,

the elephantwalker
www.elephantwalker.com



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Juan Fuentes
Sent: Friday, September 21, 2001 12:34 AM
To: Orion-Interest
Subject: CMP and BLOB fields


Hi list!

I have a CMP with a BLOB field and it does not work. I've read in the
list archives that the EJB specifications explain that a CMP cannot have
BLOB fields.

I've changed the BLOB by a LONG RAW, and it has started to work. What's
the difference between a BLOB and a LONG RAW?

If the correct one is LONG RAW, why the Serializable objects are mapped
to BLOBs instead of LONG RAWs?

I'm using orion 1.4.5 with Oracle

Thanks
--
··················································
Juan Fuentes Nieto                   Essi Projects
[EMAIL PROTECTED]    t +34 977 221 182
http://www.essiprojects.com      f +34 977 230 170
··················································


Reply via email to