After the comment from Sergi on this PR it seems to me setObject() is not a proper place to convert types at all.
Types.OTHER does not mean if value should be encoded in some particular way, it's just a marker that value type is database specific. As UUID is not mentioned in java.sql.Types - it should be treated as database specific too. So, I would say setObject(n, UUID, Types.OTHER) can be legally used for both UUID and OBJECT type columns. Theoretically that can be achieved by creating a special Value implementation which does conversion to the desired type later (e.g. in the insert/update case - based on how the actual database column is declared). Should we go this way? On Tuesday, March 29, 2016 at 12:21:57 AM UTC+6, Alex Panchenko wrote: > > I've added caching of metadata and filed this change as > https://github.com/h2database/h2database/pull/258 > > Regards, > Alex > > On Monday, March 28, 2016 at 2:41:10 PM UTC+6, Noel Grandin wrote: >> >> >> >> On 28 March 2016 at 10:37, Alex Panchenko <[email protected]> wrote: >> >>> I've updated my patch to use JdbcDatabaseMetaData., not sure about >>> performance now as a new metadata instance is created each time. >>> Should a cached instance of JdbcDatabaseMetaData be returned >>> from org.h2.jdbc.JdbcConnection.getMetaData()? >>> Doing a database query in every setObject() call is not nice. >>> >>> I would suggest caching it. >> >> Thanks, Noel >> > -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/d/optout.
