Re: PreparedStatement parameters and mutable objects

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: pg(at)fastcrypt(dot)com
Cc: Kris Jurka <books(at)ejurka(dot)com>, "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: PreparedStatement parameters and mutable objects
Date: 2004-01-12 22:44:33
Message-ID: 40032351.6030603@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Dave Cramer wrote:
> Oliver,
>
> I think finding the "offical" word on this is going to be unlikely, at
> best it will be someone's opinion. It's not in the spec so it will be an
> interpretation. I think more important is meeting the expected behaviour
> from the users POV.

I've sent an email asking for clarification to the feedback address in
the 3.0 specification. Hopefully whatever response I get will make it
into future versions of the JDBC specification.

> That being said, my example showing mutable objects and the expected
> behaviour was just that an example, I think the behaviour should be the
> same for mutable/un-mutable objects. I would expect there would be a
> population of programmers out there that isn't even aware of the fact
> that some objects are un-mutable/mutable. Unfortunately we need to code
> to the lowest common denominator.

Ouch. Pass-by-reference semantics are pretty fundamental to Java. Do we
really have to assume that our users aren't aware of this?

BTW the behaviour for mutable vs. immutable objects *will* be the same
.. it's just that for immutable objects, they don't happen to expose an
interface that allows you to change their value (that's why you call
them immutable ;). The reference semantics are identical.

-O

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2004-01-13 02:02:41 Re: PreparedStatement parameters and mutable objects
Previous Message Andrew Rawnsley 2004-01-12 22:29:23 Re: What happens to a ResultSet when statement closed