pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedAdding JDK1.5 removing 1.1 support.
8+ messages / 4 participants
[nested] [flat]
* Adding JDK1.5 removing 1.1 support.
@ 2004-07-15 12:51 Kris Jurka <books@ejurka.com>
0 siblings, 1 reply; 8+ messages in thread
From: Kris Jurka @ 2004-07-15 12:51 UTC (permalink / raw)
To: pgsql-jdbc
The new V3 protocol code has removed support for compiling with a 1.1 JDK,
but we still have the core implementation split between jdbc1 and jdbc2
classes. Should be combine these all into jdbc2 or is there a reason to
keep these separate?
To add JDK1.5 support I originally considered an ant conditional
compilation method, but that was really ugly. Another idea I have is to
create a jdbc3g subdirectory (JDBC3 w/ Generics) that wouldn't house any
implementation (AbstractJdbc3g* classes), but would just have the classes
to offer the API desired by the 1.5 JDK. This means something like
AbstractJdbc2Connection.setTypeMap(Map) would be renamed to something like
setTypeMapImpl(Map) and setTypeMap(Map) would be added to Jdbc2Connection
and Jdbc3Connection while Jdbc3gConnection would have
setTypeMap(Map<String, Class<?>>) that would all just call setTypeMapImpl.
Does this make sense to people?
Kris Jurka
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Adding JDK1.5 removing 1.1 support.
@ 2004-07-16 03:16 Oliver Jowett <oliver@opencloud.com>
parent: Kris Jurka <books@ejurka.com>
0 siblings, 1 reply; 8+ messages in thread
From: Oliver Jowett @ 2004-07-16 03:16 UTC (permalink / raw)
To: Kris Jurka <books@ejurka.com>; +Cc: pgsql-jdbc
Kris Jurka wrote:
> The new V3 protocol code has removed support for compiling with a 1.1 JDK,
> but we still have the core implementation split between jdbc1 and jdbc2
> classes. Should be combine these all into jdbc2 or is there a reason to
> keep these separate?
That sounds reasonable unless there's some reason you'd want to run
JDK1.2 + JDBC1 (I can't think of one).
> To add JDK1.5 support I originally considered an ant conditional
> compilation method, but that was really ugly. Another idea I have is to
> create a jdbc3g subdirectory (JDBC3 w/ Generics) that wouldn't house any
> implementation (AbstractJdbc3g* classes), but would just have the classes
> to offer the API desired by the 1.5 JDK.
That works.
-O
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Adding JDK1.5 removing 1.1 support.
@ 2004-07-16 08:43 Kris Jurka <books@ejurka.com>
parent: Oliver Jowett <oliver@opencloud.com>
0 siblings, 1 reply; 8+ messages in thread
From: Kris Jurka @ 2004-07-16 08:43 UTC (permalink / raw)
To: Oliver Jowett <oliver@opencloud.com>; +Cc: pgsql-jdbc
On Fri, 16 Jul 2004, Oliver Jowett wrote:
> Kris Jurka wrote:
> > The new V3 protocol code has removed support for compiling with a 1.1 JDK,
> > but we still have the core implementation split between jdbc1 and jdbc2
> > classes. Should be combine these all into jdbc2 or is there a reason to
> > keep these separate?
>
> That sounds reasonable unless there's some reason you'd want to run
> JDK1.2 + JDBC1 (I can't think of one).
Well, you can't. Previously you could run a JDBC1 build under a higher
JDK, but now we don't have the ability to compile a JDBC1 build. I've
made this change to the source tree.
>
> > To add JDK1.5 support I originally considered an ant conditional
> > compilation method, but that was really ugly. Another idea I have is to
> > create a jdbc3g subdirectory (JDBC3 w/ Generics) that wouldn't house any
> > implementation (AbstractJdbc3g* classes), but would just have the classes
> > to offer the API desired by the 1.5 JDK.
>
I've done this for the core driver, but I'm kind of stuck on how to get
this to work for the various DataSource implementations. These don't
have the same multi-version architecture and users are required to
know what JDK they are dealing with in their configuration. I don't
think I want to implement jdbc3g versions of these and have to document
when that is available and so on. I'm thinking this needs to be
redesigned to work in a general way where the correct implementation class
is selected for the user instead of requiring them to specify it directly.
This has the possibility of renaming some classes which would prevent
directly dropping a new jar file into an existing deployment without
changing some configurations, but I'm OK with that if I can get it to
work.
Kris Jurka
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Adding JDK1.5 removing 1.1 support.
@ 2004-07-16 08:59 Oliver Jowett <oliver@opencloud.com>
parent: Kris Jurka <books@ejurka.com>
0 siblings, 1 reply; 8+ messages in thread
From: Oliver Jowett @ 2004-07-16 08:59 UTC (permalink / raw)
To: Kris Jurka <books@ejurka.com>; +Cc: pgsql-jdbc
Kris Jurka wrote:
> I've done this for the core driver, but I'm kind of stuck on how to get
> this to work for the various DataSource implementations. These don't
> have the same multi-version architecture and users are required to
> know what JDK they are dealing with in their configuration.
I have to admit I haven't looked too hard at this area, but I don't
understand why we need versioned implementations of DataSource at all.
Don't they all end up delegating to the Driver to create the connection
anyway? I couldn't see anything in the JDBC3 implementations that seems
JDBC3-specific..
We currently use the jdbc2.optional datasource implementations under a
1.4 JDK, for historical reasons more than anything. But it appears to
work fine.
-O
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Adding JDK1.5 removing 1.1 support.
@ 2004-07-16 09:38 Kris Jurka <books@ejurka.com>
parent: Oliver Jowett <oliver@opencloud.com>
0 siblings, 1 reply; 8+ messages in thread
From: Kris Jurka @ 2004-07-16 09:38 UTC (permalink / raw)
To: Oliver Jowett <oliver@opencloud.com>; +Cc: pgsql-jdbc
On Fri, 16 Jul 2004, Oliver Jowett wrote:
> I have to admit I haven't looked too hard at this area, but I don't
> understand why we need versioned implementations of DataSource at all.
> Don't they all end up delegating to the Driver to create the connection
> anyway? I couldn't see anything in the JDBC3 implementations that seems
> JDBC3-specific..
There's really nothing in the JDBC3 implementations. Personally I don't
know why we have them at all. The problem is that the 1.5 JDK has changed
the API for ObjectFactory which means that PGObjectFactory and
Jdbc3ObjectFactory cannot be compiled at the moment. It looks like
adding a Jdbc3gObjectFactory can't be done without also adding 3g versions
of the other classes and also making some Abstract classes to house the
implementation. Forcing the user to select which implementation to
use just seems klunky especially if they aren't really different.
Kris Jurka
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Adding JDK1.5 removing 1.1 support.
@ 2004-07-16 10:50 Oliver Jowett <oliver@opencloud.com>
parent: Kris Jurka <books@ejurka.com>
0 siblings, 2 replies; 8+ messages in thread
From: Oliver Jowett @ 2004-07-16 10:50 UTC (permalink / raw)
To: Kris Jurka <books@ejurka.com>; +Cc: pgsql-jdbc
Kris Jurka wrote:
> The problem is that the 1.5 JDK has changed
> the API for ObjectFactory which means that PGObjectFactory and
> Jdbc3ObjectFactory cannot be compiled at the moment.
Aha, I see. generics strike again.
We could deal with the non-pooling datasources by no longer implementing
Referenceable and relying on serialization to preserve state. Then we do
not need an ObjectFactory at all.
For pooling DataSources (I mean jdbc2.optional.PoolingDataSource, not
jdbc2.optional.ConnectionPool -- those are badly named!) we could
implement readResolve()/writeReplace() to translate to/from a lookup
handle into the registry of known pools when serialized. But that gets a
bit hairy. It's probably simpler to just do conditional compilation of
the signature of PGObjectFactory.getObjectInstance() if we want to
support the pooling DataSources.
I'm actually tempted to drop the pooling DataSource implementations
altogther. Does anyone on the list actually use these? I think the more
common approach is for a higher layer to use our
ConnectionPoolDataSource implementation (or plain DataSource, even) plus
their own pooling logic..
-O
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Adding JDK1.5 removing 1.1 support.
@ 2004-07-16 12:50 Aaron Mulder <ammulder@alumni.princeton.edu>
parent: Oliver Jowett <oliver@opencloud.com>
1 sibling, 0 replies; 8+ messages in thread
From: Aaron Mulder @ 2004-07-16 12:50 UTC (permalink / raw)
To: pgsql-jdbc
On Fri, 16 Jul 2004, Oliver Jowett wrote:
> I'm actually tempted to drop the pooling DataSource implementations
> altogther. Does anyone on the list actually use these? I think the more
> common approach is for a higher layer to use our
> ConnectionPoolDataSource implementation (or plain DataSource, even) plus
> their own pooling logic..
The spec seems to have been originally written so that any
middleware should use ConnectionPoolDataSource. In practice, that seems
pretty rare -- every app server I've worked with uses an XADataSource or
DriverManager. On the other hand, most end users don't seem to know what
to make of a ConnectionPoolDataSource, since it's neither a DataSource nor
a Connection, and they don't want to implement their own pooling logic.
So if we were to drop support for anything but ConnectionPoolDataSource,
then I'm not sure that anyone would really use this stuff at all!
That said, it's hardly a scientific opinion, and I would also be
interested to hear if anyone speaks up and indicates that they're using
ConnectionPoolDataSource.
Aaron
^ permalink raw reply [nested|flat] 8+ messages in thread
* Re: Adding JDK1.5 removing 1.1 support.
@ 2004-07-16 13:40 Chris Smith <cdsmith@twu.net>
parent: Oliver Jowett <oliver@opencloud.com>
1 sibling, 0 replies; 8+ messages in thread
From: Chris Smith @ 2004-07-16 13:40 UTC (permalink / raw)
To: Oliver Jowett <oliver@opencloud.com>; Kris Jurka <books@ejurka.com>; +Cc: pgsql-jdbc
Oliver Jowett wrote:
> I'm actually tempted to drop the pooling DataSource implementations
> altogther. Does anyone on the list actually use these? I think the
> more common approach is for a higher layer to use our
> ConnectionPoolDataSource implementation (or plain DataSource, even)
> plus their own pooling logic..
I certainly do use Jdbc3PoolingDataSource, and would hate to see it go away.
--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
^ permalink raw reply [nested|flat] 8+ messages in thread
end of thread, other threads:[~2004-07-16 13:40 UTC | newest]
Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-07-15 12:51 Adding JDK1.5 removing 1.1 support. Kris Jurka <books@ejurka.com>
2004-07-16 03:16 ` Oliver Jowett <oliver@opencloud.com>
2004-07-16 08:43 ` Kris Jurka <books@ejurka.com>
2004-07-16 08:59 ` Oliver Jowett <oliver@opencloud.com>
2004-07-16 09:38 ` Kris Jurka <books@ejurka.com>
2004-07-16 10:50 ` Oliver Jowett <oliver@opencloud.com>
2004-07-16 12:50 ` Aaron Mulder <ammulder@alumni.princeton.edu>
2004-07-16 13:40 ` Chris Smith <cdsmith@twu.net>
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