Length limit trouble ( EJB read/write BLOB field)


EJB programming & troubleshooting: Length limit trouble ( EJB read/write BLOB field)

  1. Length limit trouble ( EJB read/write BLOB field) (7 messages)

    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
  2. 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.
  3. 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.
  4. 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... :)

  5. example code[ Go to top ]

    I would appreciate it if you can mail example code to jxie at admin dot fsu dot edu.

  6. Sample code for mapping Blob[ Go to top ]

    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 [email protected]
  7. ow can I mapping Blob to a class? please give me a example?
  8. I need the example also.[ Go to top ]

    I would appreciate it if you can mail example code to annieliu_ca at hotmail dot com