Hi,
> Now, when I call the code, the store method works fine, but when I
> call the retrieve method, I get an exception on the line: Object o =
> rs.getObject(1);that says:
> org.h2.jdbc.JdbcSQLException: Deserialization failed, cause:
> "java.lang.ClassNotFoundException:
> com.test.types.MyRecord" [90027-127] 
> I understand that the exception is occurring because the org.h2 code
> has no idea what a 'MyRecord' class is, down in the
> org.ht.util.ObjectUtils.deserialize() method, but again, not sure why
> its trying to get it as the 'MyRecord' class rather than an Object
> class.

First, are you sure that your class MyRecord is serializable ?

Then if your database is embeded in your app, then MyRecord would be accessible 
to H2;
but if you are in client/server you must add this class to H2 class path.

Checked that, try with a newer version ( you are in 1.2.127 and last stable is 
1.2.141)  to see if something change.
Anyway I think that is a more general approach to use a BLOB and implement your 
own object serialization/de-serialization mechanism.

regards,
Dario

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to