I use Container managed Entity Bean to read/write
BLOB date field from Oracle 8i (8.1.6) database,
that works fine,
but i found if the length of this field(BLOB) is longer
than 4000 bytes, there will be a error.
can anybody give me some advise ?
(in the program, I map the BLOB field to a class that
implements Serializable interface ,and the class contains
a String attribute)
my email : BlueHand at 163 dot com
need your help
-
Length limit trouble ( EJB read/write BLOB field) (7 messages)
- Posted by: Blue Hand
- Posted on: October 27 2001 07:16 EDT
Threaded Messages (7)
- Length limit trouble ( EJB read/write BLOB field) by Gal Binyamini on October 27 2001 20:13 EDT
- Length limit trouble ( EJB read/write BLOB field) by Blue Hand on October 28 2001 23:03 EST
- Length limit trouble ( EJB read/write BLOB field) by Gal Binyamini on October 29 2001 06:30 EST
- example code by jin xie on April 09 2004 11:21 EDT
- Sample code for mapping Blob by Sumit Garg on February 22 2007 05:37 EST
- Length limit trouble ( EJB read/write BLOB field) by Blue Hand on October 28 2001 23:03 EST
- How can I mapping Blob to a class? please give me a example? by annie liu on May 03 2004 10:01 EDT
- I need the example also. by annie liu on May 03 2004 10:15 EDT
-
Length limit trouble ( EJB read/write BLOB field)[ Go to top ]
- Posted by: Gal Binyamini
- Posted on: October 27 2001 20:13 EDT
- in response to Blue Hand
Hello.
I've had a lot of problems with using BLOBs in EJBs on iPlanet with Oracle8i.
First of all, you have to make sure that your App server suppots BLOB fields. When I had the BLOB problems, most App servers didn't. If your App server doesn't support BLOBs in specific, it probably uses getBytes/setBytes. This is big trouble. Different Oracle drivers did different things, but they might:
1. try to write the bytes as a BLOB locator instead of an actual BLOB.
2. know how to write a BLOB, but have a bug that causes them to only write 4000 or 8000 bytes, depending on the driver version (they only write a single buffer, and they change the buffer size between versions).
3. only write partial data for no appearant reason.
I've battled with this problem for about a week, contacted iPlanet support, Oracle support, etc. None of them gave me a reasonable solution. So I just took the BLOB part into another bean with BMP and used native oracle packages. I think some driver, maybe OCI, fixed some of the problems, but we didn't switch to it so it must have had other problems I can't remember.
Anyway, if things stayed the way they were when I had this problem (~10 month ago) I'd strongly recommend using the Oracle packages.
Good luck.
Gal -
Length limit trouble ( EJB read/write BLOB field)[ Go to top ]
- Posted by: Blue Hand
- Posted on: October 28 2001 23:03 EST
- in response to Gal Binyamini
Thank u so much.
someelse said , the i-net's dirver (seropto) solved this problem ,and i downed a 2-connection-trial version , but the error insist, the only change is the error message. I'm not sure if that because of trial-version. But anyway , I gave up, Now i use morethan one VARCHAR field instead of BLOB , hope in future version of jdbc driver will solve this problem. -
Length limit trouble ( EJB read/write BLOB field)[ Go to top ]
- Posted by: Gal Binyamini
- Posted on: October 29 2001 06:30 EST
- in response to Blue Hand
We also used VARCHAR (and LONG VARCHAR) as a fallback solution first. You should be aware that certain versions of the Oracle JDBC driver (I think it was the thin driver, can't remember version numbers...) have a problem that makes them write only the first 16K or 8K of your data (even in VARCHAR). Again, this has something to do with a bug in their buffering, and the exact number of bytes written is determined by the buffer size.
So be carefull... :)
Regards
Gal -
example code[ Go to top ]
- Posted by: jin xie
- Posted on: April 09 2004 11:21 EDT
- in response to Gal Binyamini
I would appreciate it if you can mail example code to jxie at admin dot fsu dot edu.
Jim -
Sample code for mapping Blob[ Go to top ]
- Posted by: Sumit Garg
- Posted on: February 22 2007 05:37 EST
- in response to Gal Binyamini
I need the sample code to map a blob field using ejb3. I am using Oracle 8i and 9i for testing. I am also using hibernate. Thanks and regards, Sumit sumit@sumitgarg.com -
How can I mapping Blob to a class? please give me a example?[ Go to top ]
- Posted by: annie liu
- Posted on: May 03 2004 10:01 EDT
- in response to Blue Hand
ow can I mapping Blob to a class? please give me a example? -
I need the example also.[ Go to top ]
- Posted by: annie liu
- Posted on: May 03 2004 10:15 EDT
- in response to Blue Hand
I would appreciate it if you can mail example code to annieliu_ca at hotmail dot com
Annie