5 Replies Latest reply on Sep 22, 2003 10:33 AM by tyang

    Oracle 8.1.7 BLOB type > 2000 byte problem

    shen Newbie

      Hi, everyone here:
      There's a problem when i used the newest jboss server with the version 2.4.0.
      I use the oracle data type 'BLOB' and the relative java type is a new class defined by myself and the class also implements java.io.serialzable.
      It seems when the data i desired inputting to the database was large than 2000 bytes, the database would be updated as null not the correct one.(I saw the source code, it discriminates the datas when they're larger than 2000 bytes or not.)
      By the way, I used the normal oracle driver(classer12.zip.
      Thanx in advance!

        • 1. Re: Oracle 8.1.7 BLOB type > 2000 byte problem
          shen Newbie

          Forget one condition, i use it as EntityBean.

          • 2. Re: Oracle 8.1.7 BLOB type > 2000 byte problem
            Per Lewau Newbie

            In order to use LOBs with the Oracle JDBC drivers you must use the OCI driver version 8.1.6 or later. Earlier versions will not work and no version of the thin driver will work (at least not with Oracle 8i, don't know about Oracle 9i).

            I had this very same problem myself and it went away when I changed to the OCI driver. This is listed in the 'known bugs' section of the JDBC driver release notes.

            • 3. Re: Oracle 8.1.7 BLOB type > 2000 byte problem
              wai wai Newbie

              > Hi, everyone here:
              > There's a problem when i used the newest jboss
              > s server with the version 2.4.0.
              > I use the oracle data type 'BLOB' and the relative
              > e java type is a new class defined by myself and the
              > class also implements java.io.serialzable.
              > It seems when the data i desired inputting to the
              > e database was large than 2000 bytes, the database
              > would be updated as null not the correct one.(I saw
              > the source code, it discriminates the datas when
              > they're larger than 2000 bytes or not.)
              > By the way, I used the normal oracle
              > e driver(classer12.zip.
              > Thanx in advance!
              >
              I encounter similar problem last year where I developed
              java servlet program.

              Instead of using BLOB data type, I used Oracle data type long
              to stored data (uploaded file) with small workaround.
              The workaround is to issue an insert statement
              (with each binding value < 1023 bytes)
              follow by update statement (with each binding value > 1023 bytes)
              because data with size > 1023 bytes fail on insert
              while it is okay with update.
              BTW, this trick works for Oracle 7.3, 8.0.5 and 8.1.5
              with jdbc type-4 driver.

              • 4. Re: Oracle 8.1.7 BLOB type > 2000 byte problem
                jamiewang Newbie

                I encount the same problem!
                Some dangerous exception will be genereated by JBOSS when you try to store more than 2000 bytes into blob field.
                By the way,I map blob field into java type:byte[].
                Finally I found the only way to overcome it is change data type BLOB into Long Raw.

                Anyone have some good suggestion?

                • 5. Re: Oracle 8.1.7 BLOB type > 2000 byte problem
                  tyang Newbie

                  I had problem with oracle thin driver if it's > 4K, I then switched to inet software's oracle driver and it worked fine (you do need to set this in the url: streamstolob=true).