0 Replies Latest reply on Jul 5, 2002 6:39 PM by crippendsl

    JBoss 2.4.4 - Using a cmp-field with type byte[]

    crippendsl

      Hi all!
      I made a liddle CMP-Bean with Jboss 2.4.4 which consist of some string-fields and one field of type byte[] (array). The field with type byte[] should store an uploaded file. I got everything working and can upload data from the web but one big issue. Right after uploading, when the CMP-bean is just created and so is activated, I can get the data from the byte[] field and can even send it back to the browser. After passivation only the data from the byte[]-cmp-field ist lost, because it was never written into the database correctly!
      It seems that there is something really wrong in JAWS!
      Here is what JAWS stores in the BLOB:

      [23:37:15,790,JAWSPersistenceManager] Store command executing: UPDATE WebDocument SET fileData=? WHERE UUID=?
      [23:37:15,791,JAWSPersistenceManager] Set parameter: idx=1, jdbcType=JAVA_OBJECT, value=[B@419e74
      [23:37:15,791,JAWSPersistenceManager] Set parameter: idx=2, jdbcType=VARCHAR, value=4492c8-eedceb7851-5d33ab2ff302ce835b992bf3a9e27b61
      [23:37:15,902,JAWSPersistenceManager] Rows affected = 1

      It seems so, that JAWS "thinks" the byte[] would be a class, because [B@419e74 really looks like a class serial or something else I have seen with object serialization. Does JAWS not recognize byte[] for CMP-fields ? I think that there is nothing unusual for the byte[]. It truely is no JAVA-OBJECT, but int and double and long and so forth aren't objects either, so why does byte[] not work ?

      Anyone here, who has successfully used a cmp-field with type byte[] in JAWS ?