Re: PreparedStatement parameters and mutable objects - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: PreparedStatement parameters and mutable objects
Date
Msg-id 3FFCF2A7.4090807@opencloud.com
Whole thread Raw
In response to Re: PreparedStatement parameters and mutable objects  (Dave Cramer <pg@fastcrypt.com>)
Responses Re: PreparedStatement parameters and mutable objects
List pgsql-jdbc
Dave Cramer wrote:
> Oliver,
>
> while I think the code snippet below has defined behaviour

What is the defined behaviour, then? It's not obvious to me whether
{1,2,3}, {42,2,3}, or a driver-dependent value (i.e. undefined
behaviour) gets inserted.

 > I think it is
> fraught with danger.

Yes :)

> As long as everyone knows that the code does this and writes code that
> does not break then yes it would work, however I don't believe this is
> the case.

I'm not sure what you mean here.

Are you saying that the driver would be incorrect to delay the
conversion, as there is existing (correct) code that expects other
behaviour?

Or are you saying that delaying the conversion is valid, but there is
existing (buggy) code that expects it not to be delayed, and we
shouldn't break that code?

Or something else entirely? :)

> Also reading the spec that you provided, I think the phrase "when it
> sends" refers to the actual conversion that takes place not the specific
> time that it is done.

Yeah .. the spec just doesn't seem to address this area at all.

-O

pgsql-jdbc by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: getTypeInfo() bug
Next
From: Dave Cramer
Date:
Subject: Re: PreparedStatement parameters and mutable objects