2 Replies Latest reply on May 24, 2002 4:37 PM by Jeffrey Wescott

    mapping a Blob > 4000 bytes using Oracle8i and JBoss2.4

    Rémi FORMICA Newbie

      Hi!

      I'm using Oracle8i to store binary data. The data is stored in a Oracle BLOB. The Oracle jdbc driver is not able to manage easily data exceeding 4000 bytes. So I used a little trick to make it go right.

      Using the Oracle jdbc driver you need to
      - create a row that contains a BLOB using SQL "EMPTY_BLOB"
      - read the inserted row to get the reference to this empty BLOB
      - write to this BLOB

      sample code:

      oracle.sql.BLOB my_blob;
      OutputStream my_outstream;
      my_blob = ((OracleResultSet)rs).getBLOB(1);
      my_outstream = my_blob.getBinaryOutputStream();
      my_outstream.write(data);
      my_outstream.close();

      Whereas JBoss maps a java.Object to an oracle BLOB.

      Is there a way to make JBoss insert a Blob that exceeds 4000 bytes properly using Oracle8i ?

      Or do you need to do it all by yourself ?

      Thanks !

        • 1. Re: mapping a Blob > 4000 bytes using Oracle8i and JBoss2.4
          Dave Elliot Newbie

          The Oracle JDBC driver (classes12.zip) is a 1.9MB embarrassment. You could try the Seropto driver from i-net software... it's only 92k, doesn't rely on proprietary extns to JDBC, and is the only type4 Oracle 8 driver than is sun certified... (and certainly handles large CLOBs for us quite nicely).


          • 2. Re: mapping a Blob > 4000 bytes using Oracle8i and JBoss2.4
            Jeffrey Wescott Newbie

            I have been trying to get the Seropto driver working for several days.

            If I use the org.inet.ora.XDataSource class, I get some XAER_NOTA errors. If I use this configuration with the Tyrex transaction manager, things seem to work (for a while), but the server eventually hangs.

            If I use the wrapper XA class provided by JBoss, things _SEEM_ to work (for a while), but the server eventually hangs.

            Since you're using the Seropto driver, can you tell me:
            1- What transaction manager do you use?
            2- Which DataSourceClass do you use?
            3- Did you need to do anything funky with the Xid class?

            Can you attach your jboss.jcml and (if you're using Tyrex), you're domain.xml?