1 Reply Latest reply on Dec 13, 2001 7:27 AM by bezdicek

    BMP Bean with Oracle 8.1.7 and BLOB

    richtmar

      Hi!
      I am using Oracle 8.1.7 with JBoss 2.4.3 and I have a BMP entity bean where the BLOB datatype from Oracle is mapped to a byte[] Array!
      I am able to deploy the bean but as soon as I call this bean, I get an exception in ejbStore():
      [Container factory] Deployed application: file:/D:/JBoss-2.4.3/tmp/deploy/Default/ejb11_tpcw.jar/
      [J2EE Deployer Default] J2EE application: file:/D:/JBoss-2.4.3/deploy/ejb11_tpcw.jar is deployed.
      [Default] Error ImageBean.ejbStore(): java.sql.SQLException: ORA-01483: invalid length for DATE- or NUMBER bind variable"

      My ejbStore() method looks like:
      ejbStore() {
      ....
      if((image != null) && (thumbnail != null)) {
      pstmt = conn.prepareStatement("update item set I_IMAGE = ?, I_THUMBNAIL = ? where I_ID = ?");
      InputStream inImage = new ByteArrayInputStream(image);
      InputStream inThumb = new new ByteeArrayInputStream(thumbnail);
      pstmt.setBinaryStream(1, inImage, image.length);
      pstmt.setBinaryStream(2, inThumb, thumbnail.length);
      pstmt.setInt(3, id);
      pstmt.executeUpdate();
      }

      ...
      }

      However, if I execute those statements directly form my own JDBC application it works!!! Also, the bean has been successfuly tested in WebLogic!

      Any ideas what could be wrong?

      Thanks.
      Markus Richter