Re: PreparedStatement parameters and mutable objects
От | Oliver Jowett |
---|---|
Тема | Re: PreparedStatement parameters and mutable objects |
Дата | |
Msg-id | 40032351.6030603@opencloud.com обсуждение исходный текст |
Ответ на | Re: PreparedStatement parameters and mutable objects (Dave Cramer <pg@fastcrypt.com>) |
Ответы |
Re: PreparedStatement parameters and mutable objects
|
Список | 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
В списке pgsql-jdbc по дате отправления: