1 Reply Latest reply on Oct 12, 2002 11:58 AM by Alexey Loubyansky

    Hypersonic > MySQL migration probs..

    alex Newbie

      Hallo

      I've decided to change the db I'm using, from Hypesonic to MySQL. I've migrated all the data that was in hypersonic into mysql. I can access most of the data without any problems. However, I store some Collection objects, which get seriased for persistence, and now I get this error when I try to access them:

      10:07:00,165 ERROR [LogInterceptor] TransactionRolledbackException,
      causedBy:
      java.sql.SQLException: Unable to load to deserialize result:
      java.io.StreamCorruptedException: invalid stream header
      at
      org.jboss.ejb.plugins.cmp.jdbc.JDBCUtil.convertByteArrayToObject(JDBCUtil.ja
      va:455)
      at
      org.jboss.ejb.plugins.cmp.jdbc.JDBCUtil.getBinaryResult(JDBCUtil.java:281)
      ...


      Under Hypersonic, the column where the Collection objects are stored is of type 'Object', and under MySQL the column is of type 'longblob'.

      Looking more closely at what goes into the db - it would appear that the serialised objects go into the db differently.. eg:
      serialised Collection with Hypersonic:
      'aced0005737200196a6176612e726d692e4d61727368616c6c65644f626a6563747cbd1e97ed63fc3e020003490004686173685b00086c6f6342797465737400025b425b00086f626a427974657371007e00017870151f8d06757200025b42acf317f8060854e0020000787000000020aced000574000f687474703a2f2f616c3a383038332f71007e000071007e00007571007e000300000088aced0005737200136a6176612e7574696c2e41727261794c6973747881d21d99c7619d03000149000473697a657870000000017704000000017372000e6a6176612e6c616e672e4c6f6e673b8be490cc8f23df0200014a000576616c7565787200106a6176612e6c616e672e4e756d62657286ac951d0b94e08b0200007870000000000000000078'

      serialised Collection with MySQL:
      '¬í\0.sr\0.java.rmi.MarshalledObject|½.—ícü>.\0.I\0.hash[\0.locBytest\0.[B[\0.objBytesq\0~\0.xpSur.ur\0.[B¬ó.ø..Tà.\0\0xp\0\0\0 ¬í\0.t\0.http://al:8083/q\0~\0\0q\0~\0\0uq\0~\0.\0\0\0–¬í\0.sr\0.java.util.ArrayListx�Ò.™Ça�.\0.I\0.sizexp\0\0\0.w.\0\0\0.sr\0.java.lang.Long;‹ä�Ì�#ß.\0.J\0.valuexr\0.java.lang.Number†¬•..”à‹.\0\0xp\0\0\0\0\0\0\0\0sq\0~\0.\0\0\0\0\0\0\0.x'

      Why is the way the objects are persisted different because of the db? And how can I get the data that is in Collection objects from Hypersonic to MySQL? Please help!


      Alex