3 Replies Latest reply on Nov 7, 2006 12:54 PM by abuayyub

    BLOB > 2K into Oracle 9

    Carsten Rudat Novice

      Hi,

      I tried - unsuccessfully - to upload a file into an ejb:

      ejb.setMyBlob(Hibernate.createBlob(inputStream));
      // no exception thrown
      


      The ejb looks like this:

      ...
      @Basic(fetch=FetchType.LAZY)
      protected java.sql.Blob myBlob;
      ...
      @Lob
      @Column(name = "myblob", columnDefinition="BLOB")
      public java.sql.Blob getMyBlob() {
       return this.myBlob;
      }
      
      public void setRtpdesign(java.sql.Blob myBlob) {
       this.myBlob = myBlob;
      }
      


      Hibernate-Properties are:
      <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle9Dialect"/>
      <property name="hibernate.hbm2ddl.auto" value="update"/>
      <property name="hibernate.jdbc.use_streams_for_binary" value="true"/>
      


      An upload of an file smaller than 2K works. But any other causes null in the database.

      What should I do?

      Best regards.
      Carsten