2 Replies Latest reply on Sep 13, 2002 12:56 PM by jakasjava

    Oracle Blobs and CMP- JBoss 3.0.2/classes12.zip

    jakasjava

      Can any one direct me, if this is a problem that can be solved. Till here JBOss rocked. I have ported the app from weblogic 6.1 with flying colors.But this exception while writing a object!!!

      This is while writing the BLOB into database. I am using classes12.zip with
      SS> oracle-service.xml.
      SS> 09/12/2002 15:57:53 PM [SunJsseListener-0] [ERROR] Could not create entity
      SS> java.lang.ClassCastException: org.jboss.ejb.plugins.cmp.jdbc.ByteArrayBlob

      Pls mail me to sudhi_bs@yahoo.com as well.

        • 1. Re: Oracle Blobs and CMP- JBoss 3.0.2/classes12.zip
          magic

          I have the same Problem with an Oracle Long Raw Field. If you solve that please write it down here.

          Thank you for answers!

          • 2. Re: Oracle Blobs and CMP- JBoss 3.0.2/classes12.zip
            jakasjava

            Instead of setting Blob and living it to implementation class like in classes12.zip, can we not convert blobs to streams and write it ....
            for instance we have package org.jboss.resource.adapter.jdbc.local.LocalPreparedStatement.java
            method setBlob can be changed to call setBinaryStream as show in belo snippet
            public void setBlob(int parameterIndex, Blob value) throws SQLException
            {
            try
            {
            Long l =new Long(value.length() );
            int leng = l.intValue();
            setBinaryStream(parameterIndex, value.getBinaryStream() , leng);
            // ps.setBlob(parameterIndex, value);
            }
            catch (SQLException e)
            {
            checkException(e);
            } // end of try-catch
            }
            like wise, change setClob to call setASCIIStream

            What do you think of this idea. Kind of worked for me. But I get IllegalStateException now. I am not sure, this is because of the bug I just inserted.!!!

            thanks
            sudhi