5 Replies Latest reply on Mar 26, 2004 8:58 AM by Stephen Coy

    Creating beans with blob data members

    Jerrold Eads Newbie

      I am creating beans that have blob data members. I am using an oracle 8i database and JBoss 3.2.3. When create() is called on a bean with a blob member I get the following error:

      Initializing testBasesBean.
      2004-03-25 16:53:53,234 DEBUG [org.jboss.ejb.plugins.LogInterceptor] InvokeHome: create(-897206490,exoo,-27605,11001,com.synapps.j2eeutility.valueobjectbase.VOBlob@1f02eaa,1XXEEEE:::WWW222NNNEEEEWWWMMMTTT444QQQQFFF333YYYGGGkkkkaaaMMMCCCyyyppppCCCRRReee\\\wwwwmmmYYYOOOlll2222EEE;;;qqqhhh9999yyyLLL[[[oooeeee;;;111g^00;;;JJJAAA\\\\SSSCCCOOOVVV1111___UUUCCC```UUUUBBB888YYYOOObbbbWWWDDDOOOlllbbbbNNNDDDXXXQQQnnnn333PPPGGGxxxnnnnH,11370,-724161430,mmmttt:::VVVVMMM999yyyBBB7777TTTccc666vvv2222YYY<<<111NNNVVVVMMM999yyyLLLBBBB???555QQQGG4444YYYEEE<<<DDD;;;;[[[QQQnnn333PPPPGGGnnneeePPPGGGGddd]]]000pppSSSSIII000qqqCCCSSSSZZZfff222sss____UUUrrr000<<>>5555PPPGGGNNNYYY<<<<111NNNDDDJJJAAAAHHH,-5477,-1101600101,Fri Mar 12 22:53:47 CST 2004,Sat Mar 13 21:07:35 CST 2004,Sat Mar 13 21:07:35 CST 2004,Sat Mar 13 21:07:35 CST 2004,21637,21637,21637,-30694,-30694,-30694,H>>>ZZZPPP===MMMMJJJUUU\\\TTTTJJJggg\\\]]]VVVVsssjjjUUULLLhhhh===333___UUUrrrrlll???555kkkaaaa???555<<<aaahhhhuuuKKKAAAmmmdddd666AAAHHH???ttttkkkCCC:::WWWLLLL999___JJJAAASSSSIII666FFFMMMYYYY___;;;CCCVVVMMMM999___LLL[[[bbbbXXX;;;111cYYYvvv;;;;XXXRRRAAA777m,mmmddd666AAAHHHmmmmkkkwwwMMMCCC0000pppBBB777JJJAAAAwwwmmm@@@OOO<<<<222EEE;;;CCC0000VVVBBB999???5555YYY444;;;111bbbbYYYDDD;;;NNNHHHHeee[[[GGG===nnnneeexxx===ZZZPPPPqqqgggSSSIII\\\\ggg0000fff]]]333sssYYYYiii;;;222PPPWWWW222999yyy\\\RRRR???444QQQFFF3333YYY;;,1,1146102973,1152258956,22NNN^^^^KKK@@@],Wed Apr 07 13:47:07 CDT 2004,Wed Apr 07 13:47:07 CDT 2004,Wed Apr 07 15:29:43 CDT 2004,SS5555\\\HHH>>>ZZZ::::WWWMMM@@@666SSSS^^^111@@@]]]SSSSjjj```333BBB____333sssFFFVVViiii___555vvvaaaXXXXuuu555III?ukkkAAA888UUUUdddSSSJJJ555[[[[GGG>>>ZZZ:::MMMMDDD___VVVAAA7777TTTJJJ]]]SSSYYYYPPP;;;222999WWWWMMM```VVVBBBRRRRYYYOOO;;;111kkkkvvvIIIXXXuuukkkkA,AA888KKKZZZwwww888???KKKkkkwwwwttt:::WWWfff9999yyyKKKAAATTT0006666FFF333YYYEEE;;;oeGGG>>>^^^^jjjqqqLLLSSSJJJJNNNDDD000pppwwww===YYYPPP222rrrrFFFMMMZZZyyy<<<<CCCRRR666uuuHHHH>>>YYYPPP<<<2222EEEUUUBBB888TTTJ777\\\\eee[[[GGG>>>^^^^jjjqqqLLLJJJTTTTqqqhhhSSSJJ,null,null,null)
      2004-03-25 16:53:53,234 DEBUG [com.genecodes.oracle8iseqcol.lane.LaneBean] setEntityContext
      2004-03-25 16:53:53,328 DEBUG [com.genecodes.oracle8iseqcol.lane.LaneBean] ejbCreate
      2004-03-25 16:53:53,343 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.keygen.JDBCOracleCreateCommand.Oracle8iSeqCol_Lane] Executing SQL: {call INSERT INTO LANE (ID, LANE_TYPE, APPLICATION_CREATOR, AUTO_ANALYSIS, AUTO_PRINT, LAST_USED, NAME, LANE_NUMBER, STATUS, THUMBPRINT, PRIMER_POSITION, RAW_DATA_START_POINT, START_EP, END_EP, START_EP_ANALYSIS, END_EP_ANALYSIS, INITIAL_SCAN_START, INITIAL_SCAN_END, LAST_SCAN_START, LAST_SCAN_END, CUSTOM_SCAN_START, CUSTOM_SCAN_END, START_COMMENT, STOP_COMMENT, ADAPTIVE_WORKED, AVERAGE_SPACING, CALCULATED_SPACING, ANALYSIS_VERSION, DATE_UPLOADED, SAMPLE_CREATION, SAMPLE_MODIFICATION, COLLECTION_SIZE_STD_NAME, COLLECTION_ANALYSIS_PARMS_NAME, SIGNAL_PROCESS_ID, RUN_ID, SAMPLE_ID) VALUES (LaneSeq.NEXTVAL, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING ID INTO ? }
      2004-03-25 16:53:53,484 ERROR [org.jboss.ejb.plugins.cmp.jdbc.keygen.JDBCOracleCreateCommand.Oracle8iSeqCol_Lane] Could not create entity
      java.sql.SQLException: ORA-01460: unimplemented or unreasonable conversion requested

      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)


      I have implemented a wrapper class for the java.sql.blob data, voblob which is used to populate the blob member. I use this class with MSSQLServer2000, MySQL and Oracle8i.

      A common data table in the legacy Oracle 8i database with the long raw that holds the blob member:

      ID NOT NULL NUMBER(15)
      LANE_TYPE NOT NULL NUMBER(15)
      APPLICATION_CREATOR NOT NULL VARCHAR2(4)
      AUTO_ANALYSIS NUMBER(6)
      AUTO_PRINT NUMBER(6)
      LAST_USED LONG RAW
      RUN_ID NUMBER(15)
      SAMPLE_ID NUMBER(15)
      SIGNAL_PROCESS_ID NUMBER(15)
      NAME VARCHAR2(255)
      LANE_NUMBER NUMBER(6)
      STATUS NUMBER(15)
      THUMBPRINT VARCHAR2(255)
      PRIMER_POSITION NUMBER(6)
      RAW_DATA_START_POINT NUMBER(15)
      START_EP DATE
      END_EP DATE
      START_EP_ANALYSIS DATE
      END_EP_ANALYSIS DATE
      INITIAL_SCAN_START NUMBER(6)
      INITIAL_SCAN_END NUMBER(6)
      LAST_SCAN_START NUMBER(6)
      LAST_SCAN_END NUMBER(6)
      CUSTOM_SCAN_START NUMBER(6)
      CUSTOM_SCAN_END NUMBER(6)
      START_COMMENT VARCHAR2(255)
      STOP_COMMENT VARCHAR2(255)
      ADAPTIVE_WORKED NUMBER(1)
      AVERAGE_SPACING NUMBER(18,6)
      CALCULATED_SPACING NUMBER(18,6)
      ANALYSIS_VERSION VARCHAR2(16)
      DATE_UPLOADED DATE
      SAMPLE_CREATION DATE
      SAMPLE_MODIFICATION DATE
      COLLECTION_SIZE_STD_NAME VARCHAR2(255)
      COLLECTION_ANALYSIS_PARMS_NAME VARCHAR2(255)

      The Standard JBossCMP-JDBC Configuration mapping for oracle8 looks like this:

      < mapping>
      < java-type>java.lang.Object< /java-type>
      < jdbc-type>LONGVARBINARY< /jdbc-type>
      < sql-type>LONG RAW< /sql-type>
      < /mapping>
      < mapping>
      < java-type>com.synapps.j2eeutility.valueobjectbase.VOBlob< /java-type>
      < jdbc-type>LONGVARBINARY< /jdbc-type>
      < sql-type>LONG RAW< /sql-type>
      < /mapping>
      < mapping>
      < java-type>com.synapps.j2eeutility.valueobjectbase.VOBlob< /java-type>
      < jdbc-type>BLOB</jdbc-type >
      < sql-type>BLOB</sql-type >
      < !--
      | Change this from BLOB to RAW(n) if you know your
      | serialized object will be <= n bytes and n <= 2000
      -- >
      < /mapping>

      Is the mapping wrong or is there another problem?