El 09/09/10 15:59, awdorrin escribió: > The MyRecord class is serializable, it is actually a JAXB generated > class. Also, I am using the database as embedded. These conditions should be sufficient for it to work. But the type "OTHER" in jdbc is in some sense an opening planned for what makes each particular implementation. "OTHER" data type seem to be displaced by the JAVA_OBJECT, DISTINCT and STRUCT in recent JDBC documentation and I never use it in a real world application.
> I have been considering pitching this approach and using the BLOB > approach instead, but after reading the release notes was a bit > hesitant to go that route, before being able to upgrade to the 1.2.141 > version of H2, sounded like there were some significant changes to the > way LOBs are handled since 1.2.127. > There are a lot of good reasons for upgrate to 1.2.141 > The documentation for the getObject() seems unclear, I thought the > deserialization should be happening on the client side, which is why I > was trying to retrieve into an Object, rather than directly into the > MyRecord class... but with the error showing that h2 knows about the > 'MyRecord' class during the getObject() call, it makes me think that > I'm inserting the object incorrectly somehow, as a MyRecord, rather > than a generic 'Object'. To be sure it would be necessary to see the source code or wait for some clarification of Thomas to know what H2 attempts to do in this case, but if it seems clear that at least tries to deserialize the concrete class as documented. > Definitely confused... and still not 100% sure if this is a H2 issue, > or perhaps a JAXB issue, but without having been able to find even one > example of how to use the setObject/getObject calls with an OTHER > datatype, I'm stumped. > Here; http://download-llnw.oracle.com/javase/6/docs/technotes/guides/jdbc/getstart/mapping.html#1033804 are recent information about JDBC4 and custom types that can clarify some how this concepts. Of course, in an standard view not necessarily implemented. Dig into SQLData interface to make custom mapping with Struct or Distinct as most appropriate for your class. This can help but it's the hard way; would be wonderful that a simple get/setObject be sufficient. 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.
