Unix Technical Forum

Which version of driver to use ?

This is a discussion on Which version of driver to use ? within the pgsql Interfaces jdbc forums, part of the PostgreSQL category; --> Hi all, We have a postgres 7.4 installation with production code running on it. The code is written in ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Interfaces jdbc

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-15-2008, 11:21 PM
Csaba Nagy
 
Posts: n/a
Default Which version of driver to use ?

Hi all,

We have a postgres 7.4 installation with production code running on it.
The code is written in Java and uses the JDBC driver to access it.

I recently discovered that the JDBC driver we were using is not properly
detecting connection problems in the pooled connection implementation to
report them to our connection pool. However, when giving a go to fix
this, I also discovered that the latest 8.0 driver fixes this problem
(I've checked the code).

So I've tried to upgrade to the 8.0 driver, but failed: our code is
pretty sloppy with the parameter types of prepared statements, and the
new driver is very strict about them. Eventually we will fix this, but
for the deployed code it's not an option.

Question: is there a way to make the 8.0 driver less strict ? E.g. we
have quite a few places where numeric fields are set with "setString",
and other things like this.

Alternatively, have anybody back-patched the connection error
notification fix to the 7.4 driver line ? If not, I could do that
myself, in this case what's the recommended way of getting the latest
7.4 sources ? Is there actually a CVS branch for it for bug-fixes ?

Thanks,
Csaba.



---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-15-2008, 11:21 PM
Csaba Nagy
 
Posts: n/a
Default Re: Which version of driver to use ?

Thanks Dave,

The connection URL version will be good I guess, I'll try tomorrow.

Cheers,
Csaba.

On Fri, 2005-06-24 at 18:25, Dave Cramer wrote:
> Csaba,
>
> Yeah, you can force v2 protocol on the 8.0 driver
>
> just add ?protocolVersion=2 to the connection url
>
> see
> http://jdbc.postgresql.org/documenta...ml#connection-
> parameters
>
> for more details
>
> re the 74 code : it's in the main server tree for version 7.4 tag is
> REL7_4_STABLE
>
> Dave
>
> On 24-Jun-05, at 11:33 AM, Csaba Nagy wrote:
>
> > Hi all,
> >
> > We have a postgres 7.4 installation with production code running on
> > it.
> > The code is written in Java and uses the JDBC driver to access it.
> >
> > I recently discovered that the JDBC driver we were using is not
> > properly
> > detecting connection problems in the pooled connection
> > implementation to
> > report them to our connection pool. However, when giving a go to fix
> > this, I also discovered that the latest 8.0 driver fixes this problem
> > (I've checked the code).
> >
> > So I've tried to upgrade to the 8.0 driver, but failed: our code is
> > pretty sloppy with the parameter types of prepared statements, and the
> > new driver is very strict about them. Eventually we will fix this, but
> > for the deployed code it's not an option.
> >
> > Question: is there a way to make the 8.0 driver less strict ? E.g. we
> > have quite a few places where numeric fields are set with "setString",
> > and other things like this.
> >
> > Alternatively, have anybody back-patched the connection error
> > notification fix to the 7.4 driver line ? If not, I could do that
> > myself, in this case what's the recommended way of getting the latest
> > 7.4 sources ? Is there actually a CVS branch for it for bug-fixes ?
> >
> > Thanks,
> > Csaba.
> >
> >
> >
> > ---------------------------(end of
> > broadcast)---------------------------
> > TIP 4: Don't 'kill -9' the postmaster
> >
> >

>



---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-15-2008, 11:21 PM
Dave Cramer
 
Posts: n/a
Default Re: Which version of driver to use ?

Csaba,

Yeah, you can force v2 protocol on the 8.0 driver

just add ?protocolVersion=2 to the connection url

see
http://jdbc.postgresql.org/documenta...ml#connection-
parameters

for more details

re the 74 code : it's in the main server tree for version 7.4 tag is
REL7_4_STABLE

Dave

On 24-Jun-05, at 11:33 AM, Csaba Nagy wrote:

> Hi all,
>
> We have a postgres 7.4 installation with production code running on
> it.
> The code is written in Java and uses the JDBC driver to access it.
>
> I recently discovered that the JDBC driver we were using is not
> properly
> detecting connection problems in the pooled connection
> implementation to
> report them to our connection pool. However, when giving a go to fix
> this, I also discovered that the latest 8.0 driver fixes this problem
> (I've checked the code).
>
> So I've tried to upgrade to the 8.0 driver, but failed: our code is
> pretty sloppy with the parameter types of prepared statements, and the
> new driver is very strict about them. Eventually we will fix this, but
> for the deployed code it's not an option.
>
> Question: is there a way to make the 8.0 driver less strict ? E.g. we
> have quite a few places where numeric fields are set with "setString",
> and other things like this.
>
> Alternatively, have anybody back-patched the connection error
> notification fix to the 7.4 driver line ? If not, I could do that
> myself, in this case what's the recommended way of getting the latest
> 7.4 sources ? Is there actually a CVS branch for it for bug-fixes ?
>
> Thanks,
> Csaba.
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>
>



---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-15-2008, 11:21 PM
Csaba Nagy
 
Posts: n/a
Default [PATCH]Re: Which version of driver to use ?

If it is of interest to anyone,

I have back-patched the PooledConnectionImpl in the JDBC driver coming
with the 7.4 postgres server to properly handle connection problems. The
code is taken from the latest 8.1 dev source with the necessary
adaptation.
Diff file is attached, was taken against CVS branch REL7_4_STABLE of the
postgres server source.

Cheers,
Csaba.


On Fri, 2005-06-24 at 18:28, Csaba Nagy wrote:
> Thanks Dave,
>
> The connection URL version will be good I guess, I'll try tomorrow.
>
> Cheers,
> Csaba.
>
> On Fri, 2005-06-24 at 18:25, Dave Cramer wrote:
> > Csaba,
> >
> > Yeah, you can force v2 protocol on the 8.0 driver
> >
> > just add ?protocolVersion=2 to the connection url
> >
> > see
> > http://jdbc.postgresql.org/documenta...ml#connection-
> > parameters
> >
> > for more details
> >
> > re the 74 code : it's in the main server tree for version 7.4 tag is
> > REL7_4_STABLE
> >
> > Dave
> >
> > On 24-Jun-05, at 11:33 AM, Csaba Nagy wrote:
> >
> > > Hi all,
> > >
> > > We have a postgres 7.4 installation with production code running on
> > > it.
> > > The code is written in Java and uses the JDBC driver to access it.
> > >
> > > I recently discovered that the JDBC driver we were using is not
> > > properly
> > > detecting connection problems in the pooled connection
> > > implementation to
> > > report them to our connection pool. However, when giving a go to fix
> > > this, I also discovered that the latest 8.0 driver fixes this problem
> > > (I've checked the code).
> > >
> > > So I've tried to upgrade to the 8.0 driver, but failed: our code is
> > > pretty sloppy with the parameter types of prepared statements, and the
> > > new driver is very strict about them. Eventually we will fix this, but
> > > for the deployed code it's not an option.
> > >
> > > Question: is there a way to make the 8.0 driver less strict ? E.g. we
> > > have quite a few places where numeric fields are set with "setString",
> > > and other things like this.
> > >
> > > Alternatively, have anybody back-patched the connection error
> > > notification fix to the 7.4 driver line ? If not, I could do that
> > > myself, in this case what's the recommended way of getting the latest
> > > 7.4 sources ? Is there actually a CVS branch for it for bug-fixes ?
> > >
> > > Thanks,
> > > Csaba.
> > >
> > >
> > >
> > > ---------------------------(end of
> > > broadcast)---------------------------
> > > TIP 4: Don't 'kill -9' the postmaster
> > >
> > >

> >

>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly



---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:47 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com