This is also related to UUID type support, e.g. in the following snippet 
the last call just fails, as result of java serialization can't be inserted 
into the uuid column.

stat.execute("create table test(k uuid)");
final PreparedStatement ps = conn.prepareStatement("insert into test (k) 
values (?)");
ps.setObject(1, new UUID(0, 1));
ps.execute();
ps.setObject(1, new UUID(0, 2), Types.OTHER);
ps.execute();

As UUID is natively supported, I think there should be a legal way to pass 
it via both functions. Makes sense?

As a bare minimum I would suggest the following 
change https://github.com/panchenko/h2database/compare/master...setObject-OTHER

Should it check mode, another connection property or a system one?
Would it makes if setObject(...OTHER) just calls setObject() without type 
if this mode is enabled?

Regards,
Alex

On Friday, March 25, 2016 at 5:46:49 PM UTC+6, Noel Grandin wrote:
>
> Yeah, this will need a feature flag. Have a look at how our code deals 
> with the varying features of MySQL Postgres oracle etc. 
> On Thu, 24 Mar 2016 at 18:06, Sergi Vladykin <[email protected] 
> <javascript:>> wrote:
>
>> Your patch will break backward compatibility, so just changing this 
>> behavior is unacceptable.
>> But if this will only work in PostgreSQL mode then probably this is ok.
>>
>> Sergi
>>
>> 2016-03-24 16:38 GMT+03:00 Alex Panchenko <[email protected] 
>> <javascript:>>:
>>
>>> Hello,
>>>
>>> For PostgreSQL this method call is used to pass json values (and xml 
>>> too).
>>> In H2 this method performs java serialization of the string value.
>>>
>>> Types.OTHER is documented as "database specific" and it seems 
>>> that JAVA_OBJECT is a more explicit way to java serialization.
>>>
>>> I would like to submit a patch keeping string without changes, if there 
>>> are chances it would be accepted.
>>> What do you think?
>>>
>>> Regards,
>>> Alex
>>>
>>> -- 
>>> 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] <javascript:>.
>>> To post to this group, send email to [email protected] 
>>> <javascript:>.
>>> Visit this group at https://groups.google.com/group/h2-database.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> -- 
>> 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] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/h2-database.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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.

Reply via email to