On Monday, March 28, 2016 at 1:45:48 PM UTC+6, Noel Grandin wrote:
>
>
>
> On 28 March 2016 at 08:22, Alex Panchenko <[email protected] 
> <javascript:>> wrote:
>
>> As UUID is natively supported, I think there should be a legal way to 
>> pass it via both functions. Makes sense?
>>
>> Why? The first call works fine, is the second call something PostgreSQL 
> does?
>

PostgreSQL supports passing UUID in both ways. I am not doing this call 
directly, most of the time it happens thru some libraries, e.g.:

org.springframework.jdbc.core.JdbcTemplate.update(String sql, Object[] args, 
int[] argTypes)

I admit that's not explicitly mentioned in PreparedStatement javadocs, 
however I think it would be good if something is possible with one 
setObject() method than it should be also possible with another method 
having more parameters.
That's a natural expectation from an overloaded method.
 

>  
>
>> 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?
>>
>
> Have a look at how JdbcDatabaseMetaData checks the current mode.
>

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.
 

>  
>
>> Would it makes if setObject(...OTHER) just calls setObject() without type 
>> if this mode is enabled?
>>
>> Hmm, I would suspect that is likely to break stuff, I would prefer a 
> minimal change that only affects the precise problem you are facing.
>
>
> Thanks, Noel
>

Thanks,
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].
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