From: Oliver Jowett <oliver@opencloud.com>
To: Kris Jurka <books@ejurka.com>
Cc: Markus Schaber <schabios@logi-track.com>
Cc: PostGreSQL JDBC <pgsql-jdbc@postgresql.org>
Subject: Re: Avoiding explicit addDataType calls for PostGIS
Date: Wed, 20 Oct 2004 10:36:39 +1300
Message-ID: <417588E7.7020205@opencloud.com> (raw)
In-Reply-To: <Pine.BSO.4.56.0410190144280.28027@leary.csoft.net>
References: <20041006181653.4fc83924@kingfisher.intern.logi-track.com>
<41645F7A.2040106@opencloud.com>
<20041007104603.78af41f3@kingfisher.intern.logi-track.com>
<416B63BF.4090304@opencloud.com>
<Pine.BSO.4.56.0410190144280.28027@leary.csoft.net>
Kris Jurka wrote:
> 1) Is the name postgresql.properties with no package name a good idea? It
> doesn't seem ideal for an application to have to create an org/postgresql
> directory just to hold a properties file,
Yes, that's what I was trying to avoid.
> but I don't like the idea of invading a global namespace.
We should be OK so long as we don't get a conflict with some other
postgresql-related java application (who else is going to use that
name?) We could call it 'postgresql.jdbc-driver.properties' or something
if you like.
> 2) I notice you've set the default prepareThreshold to five as we agreed
> to a while ago, but I haven't gotten around to doing. The reason I
> haven't done it yet is because I was concerned about how to do this (and
> keep it in sync) for the DataSource implementations. With this patch it
> is impossible to set the prepareThreshold back to zero from the
> DataSource. It would be a simple fix to change the DataSource code to
> make this work, but since we're discussing the general ability to set
> defaults I thought I'd bring it up.
This is a bit of a can of worms..
The datasource implementations don't currently provide access to many of
the useful properties the driver has.
The ones it does support are handled via generating an appropriate URL
to pass to getConnection(). This is going to get unwieldly very fast.
I'd suggest using the Properties variant of getConnection() to pass
extra options in.
How should defaults interact with datasource settings? If you serialize
a configured datasource and later deserialize it in an environment where
the driver defaults are different, do you get the updated defaults for
values you didn't set on the datasource, or do you get the defaults at
the time the object was serialized?
Should we distinguish "not set" from "set to X" for all properties? This
plays more nicely with defaults ("not set" means "use default") but also
means we can't easily use primitive types in the accessors (e.g.
get/setPrepareThreshold would have to deal in something other than a
bare 'int'). This also seems necessary for things like the ssl property
in its current form.
Should it be possible to reset a datasource property to "not set" after
setting it to something else?
If you call a getter on a datasource when the underlying value is
defaulted (i.e. not explicitly set) should you get a result meaning
"this value is at whatever the default is" or should the datasource look
up the actual default that would be used if you created a connection
right now and return that?
For the datatype.* properties, how do we map them to datasource
accessors? Having many separate properties is nice from the point of
view of being able to incrementally add to the property via different
defaults files, but it's nasty to map to a JavaBean-like accessors (and
also makes Driver.getPropertyInfo() impossible to completely implement).
Perhaps an array-based accessor, one element per datatype?
Alternatively, collapse all the datatype stuff down to a single property
and teach the property-munging code how to merge (rather than replace)
multiple settings of that property together. (this second option is more
like what JNDI property files do)
phew.
-O
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: oliver@opencloud.com, books@ejurka.com, schabios@logi-track.com
Subject: Re: Avoiding explicit addDataType calls for PostGIS
In-Reply-To: <417588E7.7020205@opencloud.com>
References: <20041006181653.4fc83924@kingfisher.intern.logi-track.com> <41645F7A.2040106@opencloud.com> <20041007104603.78af41f3@kingfisher.intern.logi-track.com> <416B63BF.4090304@opencloud.com> <Pine.BSO.4.56.0410190144280.28027@leary.csoft.net> <417588E7.7020205@opencloud.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox