pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
8.0 drivers released.
6+ messages / 4 participants
[nested] [flat]

* 8.0 drivers released.
@ 2005-01-17 12:48 Kris Jurka <books@ejurka.com>
  2005-01-18 10:51 ` Re: 8.0 drivers released. Andreas Joseph Krogh <andreak@officenet.no>
  2005-01-18 14:51 ` Re: 8.0 drivers released. Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 2 replies; 6+ messages in thread

From: Kris Jurka @ 2005-01-17 12:48 UTC (permalink / raw)
  To: pgsql-jdbc


With the 8.0 server release coming later this week, I've put up a new set 
of JDBC drivers.  I haven't had time to write up a full set of release 
notes, so this email will have to suffice for now...

Naturally there are a huge number of minor improvements and fixes, 
but these are the big things in 8.0:

- True V3 protocol support.
- Savepoints.
- No more "idle in transaction" problems.
- Binary data doesn't use fifty times the necessary memory.
- SSL connection customization
- driver configuration via properties file
- 5.0 JDK compiles 

Major compatibility issues that come to mind immediately.

The driver now always uses some form of server prepared statement.  This 
means that all data is now strongly typed instead of mashed together into 
a query string for the server to figure out.  If you have an application 
that uses setString(x, myString) for every type, you are not going to be 
happy.  The driver needs to know what the real column type is in the 
database and it infers this from the setXXX call you make.  This presents 
some tricky problems when dealing with postgresql datatypes that do not 
match up exactly with Java datatypes that are only solved by using a 
custom PGobject subclass to pass both the data and the correct type to the 
driver.  This also extends to null values, no longer is setObject(x, null) 
valid because it does not contain type information for the driver to use.

Previously Statement.executeQuery("INSERT ... ; SELECT currval('myseq')"); 
would return a ResultSet.  This is no longer true and I don't believe it 
was ever strictly legal.  This should be correctly written in separate 
queries or:

Statement.execute("INSERT ...; SELECT currval('myseq')");
Statement.getMoreResults();
ResultSet rs = Statement.getResultSet();

Calling PreparedStatement.setBinaryStream now requires a correct length 
argument.  Previously Integer.MAX_VALUE or similar could be used and it 
would read the stream to completion, but with the ability to stream data 
directly to the server and not use up outrageous amounts of memory means 
that we need to know the correct length from the outset.

Kris Jurka



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: 8.0 drivers released.
  2005-01-17 12:48 8.0 drivers released. Kris Jurka <books@ejurka.com>
@ 2005-01-18 10:51 ` Andreas Joseph Krogh <andreak@officenet.no>
  2005-01-18 11:58   ` Re: 8.0 drivers released. Oliver Jowett <oliver@opencloud.com>
  1 sibling, 1 reply; 6+ messages in thread

From: Andreas Joseph Krogh @ 2005-01-18 10:51 UTC (permalink / raw)
  To: Kris Jurka <books@ejurka.com>; +Cc: pgsql-jdbc

On Monday 17 January 2005 13:48, Kris Jurka wrote:
> With the 8.0 server release coming later this week, I've put up a new set
> of JDBC drivers.  I haven't had time to write up a full set of release
> notes, so this email will have to suffice for now...
>
> Naturally there are a huge number of minor improvements and fixes,
> but these are the big things in 8.0:
>
> - True V3 protocol support.
> - Savepoints.
> - No more "idle in transaction" problems.
> - Binary data doesn't use fifty times the necessary memory.
> - SSL connection customization
> - driver configuration via properties file
> - 5.0 JDK compiles
>
> Major compatibility issues that come to mind immediately.
>
> The driver now always uses some form of server prepared statement.  This
> means that all data is now strongly typed instead of mashed together into
> a query string for the server to figure out.  If you have an application
> that uses setString(x, myString) for every type, you are not going to be
> happy.  The driver needs to know what the real column type is in the
> database and it infers this from the setXXX call you make.  This presents
> some tricky problems when dealing with postgresql datatypes that do not
> match up exactly with Java datatypes that are only solved by using a
> custom PGobject subclass to pass both the data and the correct type to the
> driver.  This also extends to null values, no longer is setObject(x, null)
> valid because it does not contain type information for the driver to use.
>
> Previously Statement.executeQuery("INSERT ... ; SELECT currval('myseq')");
> would return a ResultSet.  This is no longer true and I don't believe it
> was ever strictly legal.  This should be correctly written in separate
> queries or:
>
> Statement.execute("INSERT ...; SELECT currval('myseq')");
> Statement.getMoreResults();
> ResultSet rs = Statement.getResultSet();
>
> Calling PreparedStatement.setBinaryStream now requires a correct length
> argument.  Previously Integer.MAX_VALUE or similar could be used and it
> would read the stream to completion, but with the ability to stream data
> directly to the server and not use up outrageous amounts of memory means
> that we need to know the correct length from the outset.
>
> Kris Jurka

Hi!
I tried using postgresql-8.0.309.jdbc2.jar (and jdbc3) and got the following 
NullPointerException:
Caused by: java.lang.NullPointerException
        at org.postgresql.Driver.getDefaultProperties(Driver.java:84)
        at org.postgresql.Driver.connect(Driver.java:167)
        at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:599)

Any explaination?

-- 
Andreas Joseph Krogh <andreak@officenet.no>
Senior Software Developer / Manager
gpg public_key: http://dev.officenet.no/~andreak/public_key.asc
------------------------+---------------------------------------------+
OfficeNet AS            | Can i wash my clothes with my dvd drive?    |
Hoffsveien 17           | Or do i need to replace it with a washing   |
PO. Box 425 Skøyen      | machine??                                   |
0213 Oslo               |                                             |
NORWAY                  |                                             |
Phone : +47 22 13 01 00 |                                             |
Direct: +47 22 13 10 03 |                                             |
Mobile: +47 909  56 963 |                                             |
------------------------+---------------------------------------------+

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: 8.0 drivers released.
  2005-01-17 12:48 8.0 drivers released. Kris Jurka <books@ejurka.com>
  2005-01-18 10:51 ` Re: 8.0 drivers released. Andreas Joseph Krogh <andreak@officenet.no>
@ 2005-01-18 11:58   ` Oliver Jowett <oliver@opencloud.com>
  2005-01-18 12:15     ` Re: 8.0 drivers released. Andreas Joseph Krogh <andreak@officenet.no>
  2005-01-18 22:17     ` Re: 8.0 drivers released. Oliver Jowett <oliver@opencloud.com>
  0 siblings, 2 replies; 6+ messages in thread

From: Oliver Jowett @ 2005-01-18 11:58 UTC (permalink / raw)
  To: Andreas Joseph Krogh <andreak@officenet.no>; +Cc: Kris Jurka <books@ejurka.com>; pgsql-jdbc

Andreas Joseph Krogh wrote:

> NullPointerException:
> Caused by: java.lang.NullPointerException
>         at org.postgresql.Driver.getDefaultProperties(Driver.java:84)
>         at org.postgresql.Driver.connect(Driver.java:167)
>         at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:599)

Driver.java:84 is:

Enumeration urlEnum = 
getClass().getClassLoader().getResources("org/postgresql/driverconfig.properties");

I guess that org.postgresql.Driver is being loaded by the bootstrap 
classloader (getClassLoader() returns null). How exactly are you getting 
the driver jar into the classpath?

-O



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: 8.0 drivers released.
  2005-01-17 12:48 8.0 drivers released. Kris Jurka <books@ejurka.com>
  2005-01-18 10:51 ` Re: 8.0 drivers released. Andreas Joseph Krogh <andreak@officenet.no>
  2005-01-18 11:58   ` Re: 8.0 drivers released. Oliver Jowett <oliver@opencloud.com>
@ 2005-01-18 12:15     ` Andreas Joseph Krogh <andreak@officenet.no>
  1 sibling, 0 replies; 6+ messages in thread

From: Andreas Joseph Krogh @ 2005-01-18 12:15 UTC (permalink / raw)
  To: Oliver Jowett <oliver@opencloud.com>; +Cc: pgsql-jdbc

On Tuesday 18 January 2005 12:58, you wrote:
> Andreas Joseph Krogh wrote:
> > NullPointerException:
> > Caused by: java.lang.NullPointerException
> >         at org.postgresql.Driver.getDefaultProperties(Driver.java:84)
> >         at org.postgresql.Driver.connect(Driver.java:167)
> >         at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:599)
>
> Driver.java:84 is:
>
> Enumeration urlEnum =
> getClass().getClassLoader().getResources("org/postgresql/driverconfig.prope
>rties");
>
> I guess that org.postgresql.Driver is being loaded by the bootstrap
> classloader (getClassLoader() returns null). How exactly are you getting
> the driver jar into the classpath?

I saw that line too, but would never have guessed that getClassLoader() 
returnes null(don't know much about classloaders). I'm trying to load a 
ConnectionPool in Tomcat-5.0.28 and had my pg.jar in 
$TOMCAT_HOME/common/endorsed/, when I moved it to $TOMCAT_HOME/common/lib/ it 
works ok. It used to work in common/endorsed with previous releases(including 
8.0.beta4 which is the last one I tried before 8.0 final).

Anyway, the problem is now gone, thanks!

-- 
Andreas Joseph Krogh <andreak@officenet.no>
Senior Software Developer / Manager
gpg public_key: http://dev.officenet.no/~andreak/public_key.asc
------------------------+---------------------------------------------+
OfficeNet AS            | Can i wash my clothes with my dvd drive?    |
Hoffsveien 17           | Or do i need to replace it with a washing   |
PO. Box 425 Skøyen      | machine??                                   |
0213 Oslo               |                                             |
NORWAY                  |                                             |
Phone : +47 22 13 01 00 |                                             |
Direct: +47 22 13 10 03 |                                             |
Mobile: +47 909  56 963 |                                             |
------------------------+---------------------------------------------+

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: 8.0 drivers released.
  2005-01-17 12:48 8.0 drivers released. Kris Jurka <books@ejurka.com>
  2005-01-18 10:51 ` Re: 8.0 drivers released. Andreas Joseph Krogh <andreak@officenet.no>
  2005-01-18 11:58   ` Re: 8.0 drivers released. Oliver Jowett <oliver@opencloud.com>
@ 2005-01-18 22:17     ` Oliver Jowett <oliver@opencloud.com>
  1 sibling, 0 replies; 6+ messages in thread

From: Oliver Jowett @ 2005-01-18 22:17 UTC (permalink / raw)
  To: Oliver Jowett <oliver@opencloud.com>; +Cc: Andreas Joseph Krogh <andreak@officenet.no>; Kris Jurka <books@ejurka.com>; pgsql-jdbc

Oliver Jowett wrote:
> Andreas Joseph Krogh wrote:
> 
>> NullPointerException:
>> Caused by: java.lang.NullPointerException
>>         at org.postgresql.Driver.getDefaultProperties(Driver.java:84)
>>         at org.postgresql.Driver.connect(Driver.java:167)
>>         at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:599)
> 
> Driver.java:84 is:
> 
> Enumeration urlEnum = 
> getClass().getClassLoader().getResources("org/postgresql/driverconfig.properties"); 
> 
> I guess that org.postgresql.Driver is being loaded by the bootstrap 
> classloader (getClassLoader() returns null). How exactly are you getting 
> the driver jar into the classpath?

I can reproduce the exception by running test code when the driver is 
loaded from the bootstrap classpath 
('-Xbootclasspath/a:jars/postgresql.jar')

It seems reasonable to fall back to the system classloader if the driver 
was loaded from the bootstrap classloader. I will commit a change to do 
this shortly.

-O



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: 8.0 drivers released.
  2005-01-17 12:48 8.0 drivers released. Kris Jurka <books@ejurka.com>
@ 2005-01-18 14:51 ` Peter Eisentraut <peter_e@gmx.net>
  1 sibling, 0 replies; 6+ messages in thread

From: Peter Eisentraut @ 2005-01-18 14:51 UTC (permalink / raw)
  To: Kris Jurka <books@ejurka.com>; +Cc: pgsql-jdbc

Am Montag, 17. Januar 2005 13:48 schrieb Kris Jurka:
> With the 8.0 server release coming later this week, I've put up a new set
> of JDBC drivers.  I haven't had time to write up a full set of release
> notes, so this email will have to suffice for now...

Could you please not name the tarballs "postgresql-8.0.309.src.tar.gz" etc.  I 
think there is a chance that this will be confused with postgresql proper.  
Maybe "postgresql-jdbc" is a better stem.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2005-01-18 22:17 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-01-17 12:48 8.0 drivers released. Kris Jurka <books@ejurka.com>
2005-01-18 10:51 ` Andreas Joseph Krogh <andreak@officenet.no>
2005-01-18 11:58   ` Oliver Jowett <oliver@opencloud.com>
2005-01-18 12:15     ` Andreas Joseph Krogh <andreak@officenet.no>
2005-01-18 22:17     ` Oliver Jowett <oliver@opencloud.com>
2005-01-18 14:51 ` Peter Eisentraut <peter_e@gmx.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