Thread: 9.1 JDBC 4 driver

9.1 JDBC 4 driver

From
Prasanth Reddy
Date:
Hi,

We have been using 8.4 jdbc3 driver. Recently we have upgraded it to 9.1-901 JDBC 4 jar.  I am getting an error message
(org.postgresql.util.PSQLException:Bad value for type int : 2618079772) while 
updating some columns. The column I am updating is a date column and I am using updateDate function of the rowset. Did
somegoogle search and found a really old post 
(http://archives.postgresql.org/pgsql-jdbc/2007-03/msg00029.php) that talked about oid being returned as Integer and
causingthis problem when the oid is too big. Below I am including the stack trace. 

I have reverted to 8.4 jdbc3 driver and the same code works fine.  So is this a bug in jdbc4?

Thanks,
Prasanth

org.postgresql.util.PSQLException: Bad value for type int : 2618079772
    at org.postgresql.jdbc2.AbstractJdbc2ResultSet.toInt(AbstractJdbc2ResultSet.java:2731)
    at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getInt(AbstractJdbc2ResultSet.java:1983)
    at org.postgresql.jdbc2.AbstractJdbc2ResultSetMetaData.fetchFieldMetaData(AbstractJdbc2ResultSetMetaData.java:242)
    at org.postgresql.jdbc2.AbstractJdbc2ResultSetMetaData.getBaseColumnName(AbstractJdbc2ResultSetMetaData.java:179)
    at org.postgresql.jdbc2.AbstractJdbc2ResultSet.updateValue(AbstractJdbc2ResultSet.java:2924)
    at org.postgresql.jdbc2.AbstractJdbc2ResultSet.updateDate(AbstractJdbc2ResultSet.java:1097)
    at com.sun.rowset.JdbcRowSetImpl.updateDate(JdbcRowSetImpl.java:2489)
    at com.sun.rowset.JdbcRowSetImpl.updateDate(JdbcRowSetImpl.java:2869)
    at com.nqadmin.swingSet.datasources.SSJdbcRowSetImpl.updateDate(SSJdbcRowSetImpl.java:697)
    at com.nqadmin.swingSet.formatting.SSFormattedTextField.updateRowSet(SSFormattedTextField.java:893)
    at com.nqadmin.swingSet.formatting.SSFormattedTextField.updateFieldValue(SSFormattedTextField.java:822)
    at com.nqadmin.swingSet.formatting.SSFormattedTextField.access$0(SSFormattedTextField.java:793)
    at com.nqadmin.swingSet.formatting.SSFormattedTextField$internalVerifier.verify(SSFormattedTextField.java:751)
    at javax.swing.InputVerifier.shouldYieldFocus(InputVerifier.java:132)
    at javax.swing.JComponent$1.acceptRequestFocus(JComponent.java:3589)
    at java.awt.Component.isRequestFocusAccepted(Component.java:7728)
    at java.awt.Component.requestFocusHelper(Component.java:7610)
    at java.awt.Component.requestFocusHelper(Component.java:7603)
    at java.awt.Component.requestFocus(Component.java:7411)
    at javax.swing.JComponent.requestFocus(JComponent.java:1476)
    at javax.swing.text.DefaultCaret.adjustFocus(DefaultCaret.java:530)
    at javax.swing.text.DefaultCaret.adjustCaretAndFocus(DefaultCaret.java:503)
    at javax.swing.text.DefaultCaret.mousePressed(DefaultCaret.java:492)
    at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:280)
    at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:279)
    at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:279)
    at java.awt.Component.processMouseEvent(Component.java:6502)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
    at java.awt.Component.processEvent(Component.java:6270)
    at java.awt.Container.processEvent(Container.java:2229)
    at java.awt.Component.dispatchEventImpl(Component.java:4861)
    at java.awt.Container.dispatchEventImpl(Container.java:2287)
    at java.awt.Component.dispatchEvent(Component.java:4687)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4489)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
    at java.awt.Container.dispatchEventImpl(Container.java:2273)
    at java.awt.Window.dispatchEventImpl(Window.java:2713)
    at java.awt.Component.dispatchEvent(Component.java:4687)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:707)
    at java.awt.EventQueue.access$000(EventQueue.java:101)
    at java.awt.EventQueue$3.run(EventQueue.java:666)
    at java.awt.EventQueue$3.run(EventQueue.java:664)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
    at java.awt.EventQueue$4.run(EventQueue.java:680)
    at java.awt.EventQueue$4.run(EventQueue.java:678)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:677)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)


Re: 9.1 JDBC 4 driver

From
Maciek Sakrejda
Date:
On Wed, Apr 25, 2012 at 11:58 AM, Prasanth Reddy <dbadmin@nqadmin.com> wrote:
> We have been using 8.4 jdbc3 driver. Recently we have upgraded it to 9.1-901 JDBC 4 jar.  I am getting an error
message(org.postgresql.util.PSQLException: Bad value for type int : 2618079772) while 
> updating some columns. The column I am updating is a date column and I am using updateDate function of the rowset.
Didsome google search and found a really old post 
> (http://archives.postgresql.org/pgsql-jdbc/2007-03/msg00029.php) that talked about oid being returned as Integer and
causingthis problem when the oid is too big. Below I am including the stack trace. 
>
> I have reverted to 8.4 jdbc3 driver and the same code works fine.  So is this a bug in jdbc4?

The follow-up to the post you linked suggests that the issue had been
fixed at the time, so it may be a different manifestation of the same
thing, but a similar-looking bug was recently fixed in git:

https://github.com/pgjdbc/pgjdbc/commit/4d60ea616eff61262721176db6e77819a23f6dc2

As far as I can tell, though, there are no official builds available
that include this fix yet, so you would have to build from source
(although given that this is a fairly serious issue *if* it does bite
you, perhaps it's time for another release?)
---
Maciek Sakrejda | System Architect | Truviso

1065 E. Hillsdale Blvd., Suite 215
Foster City, CA 94404
(650) 242-3500 Main
www.truviso.com

Re: 9.1 JDBC 4 driver

From
"Kevin Grittner"
Date:
Maciek Sakrejda <msakrejda@truviso.com> wrote:

> As far as I can tell, though, there are no official builds
> available that include this fix yet, so you would have to build
> from source (although given that this is a fairly serious issue
> *if* it does bite you, perhaps it's time for another release?)

+1

I keep pointing people to this page and encouraging them to upgrade
if they are on an earlier release:

http://jdbc.postgresql.org/download.html#current

If we're going to use language like that, we should be diligent
about not leaving a version there which has bugs not present in
earlier versions.

-Kevin

Re: 9.1 JDBC 4 driver

From
Prasanth Reddy
Date:
The fix seems to coincide with the stack trace location of mine.  But in the fix added, the long value seems to be
castedto int again. Wouldn't this cause problem when the value of oid has exceeded 
the int range of java? Why not use long data type  for table and column variable?

It would be great if we can get a new jar with the fix.

Thanks,
Prasanth

On Wed, Apr 25, 2012 at 11:58 AM, Prasanth Reddy <dbadmin@nqadmin.com> wrote:
> We have been using 8.4 jdbc3 driver. Recently we have upgraded it to 9.1-901 JDBC 4 jar.  I am getting an error
message(org.postgresql.util.PSQLException: Bad value for type int : 2618079772) while  
> updating some columns. The column I am updating is a date column and I am using updateDate function of the rowset.
Didsome google search and found a really old post  
> (http://archives.postgresql.org/pgsql-jdbc/2007-03/msg00029.php) that talked about oid being returned as Integer and
causingthis problem when the oid is too big. Below I am including the stack trace.  
>
> I have reverted to 8.4 jdbc3 driver and the same code works fine.  So is this a bug in jdbc4?

The follow-up to the post you linked suggests that the issue had been
fixed at the time, so it may be a different manifestation of the same
thing, but a similar-looking bug was recently fixed in git:

https://github.com/pgjdbc/pgjdbc/commit/4d60ea616eff61262721176db6e77819a23f6dc2

As far as I can tell, though, there are no official builds available
that include this fix yet, so you would have to build from source
(although given that this is a fairly serious issue *if* it does bite
you, perhaps it's time for another release?)
---
Maciek Sakrejda | System Architect | Truviso

1065 E. Hillsdale Blvd., Suite 215
Foster City, CA 94404
(650) 242-3500 Main
www.truviso.com


Re: 9.1 JDBC 4 driver

From
Dave Cramer
Date:
Ok,

I have tagged 902 and uploaded a jar to jdbc.postgresql.jar and
updated the download page

Please let me know if there are any issues with this jar.

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca


On Wed, Apr 25, 2012 at 4:34 PM, Prasanth Reddy <dbadmin@nqadmin.com> wrote:
>
> The fix seems to coincide with the stack trace location of mine.  But in the fix added, the long value seems to be
castedto int again. Wouldn't this cause problem when the value of oid has exceeded 
> the int range of java? Why not use long data type  for table and column variable?
>
> It would be great if we can get a new jar with the fix.
>
> Thanks,
> Prasanth
>
> On Wed, Apr 25, 2012 at 11:58 AM, Prasanth Reddy <dbadmin@nqadmin.com> wrote:
>> We have been using 8.4 jdbc3 driver. Recently we have upgraded it to 9.1-901 JDBC 4 jar.  I am getting an error
message(org.postgresql.util.PSQLException: Bad value for type int : 2618079772) while 
>> updating some columns. The column I am updating is a date column and I am using updateDate function of the rowset.
Didsome google search and found a really old post 
>> (http://archives.postgresql.org/pgsql-jdbc/2007-03/msg00029.php) that talked about oid being returned as Integer and
causingthis problem when the oid is too big. Below I am including the stack trace. 
>>
>> I have reverted to 8.4 jdbc3 driver and the same code works fine.  So is this a bug in jdbc4?
>
> The follow-up to the post you linked suggests that the issue had been
> fixed at the time, so it may be a different manifestation of the same
> thing, but a similar-looking bug was recently fixed in git:
>
> https://github.com/pgjdbc/pgjdbc/commit/4d60ea616eff61262721176db6e77819a23f6dc2
>
> As far as I can tell, though, there are no official builds available
> that include this fix yet, so you would have to build from source
> (although given that this is a fairly serious issue *if* it does bite
> you, perhaps it's time for another release?)
> ---
> Maciek Sakrejda | System Architect | Truviso
>
> 1065 E. Hillsdale Blvd., Suite 215
> Foster City, CA 94404
> (650) 242-3500 Main
> www.truviso.com
>
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc

Re: 9.1 JDBC 4 driver

From
Kris Jurka
Date:

On Wed, 25 Apr 2012, Dave Cramer wrote:

> I have tagged 902 and uploaded a jar to jdbc.postgresql.jar and
> updated the download page
>
> Please let me know if there are any issues with this jar.

You tagged and released 9.2-dev, not the 9.1 branch.  Please undo
immediately.  Also you need to change the driver version in
org/postgresql/util/PSQLDriverVersion.java.

You should also try to build a JDBC3 release at the same time.

Kris Jurka

Re: 9.1 JDBC 4 driver

From
Dave Cramer
Date:
On Wed, Apr 25, 2012 at 7:59 PM, Kris Jurka <books@ejurka.com> wrote:
>
>
> On Wed, 25 Apr 2012, Dave Cramer wrote:
>
>> I have tagged 902 and uploaded a jar to jdbc.postgresql.jar and
>> updated the download page
>>
>> Please let me know if there are any issues with this jar.
>
> You tagged and released 9.2-dev, not the 9.1 branch.  Please undo
> immediately.  Also you need to change the driver version in
> org/postgresql/util/PSQLDriverVersion.java.
>
> You should also try to build a JDBC3 release at the same time.
>
> Kris Jurka

Whoops, should be better this time.

I will try to build a jdbc3 jar as soon as possible, probably Friday now

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca

Re: 9.1 JDBC 4 driver

From
Prasanth Reddy
Date:
Downloaded the jar and is working great. Thanks for releasing a new jar.

Appreciate your help.

-Prasanth

On Wed, Apr 25, 2012 at 7:59 PM, Kris Jurka <books@ejurka.com> wrote:
>
>
> On Wed, 25 Apr 2012, Dave Cramer wrote:
>
>> I have tagged 902 and uploaded a jar to jdbc.postgresql.jar and
>> updated the download page
>>
>> Please let me know if there are any issues with this jar.
>
> You tagged and released 9.2-dev, not the 9.1 branch.  Please undo
> immediately.  Also you need to change the driver version in
> org/postgresql/util/PSQLDriverVersion.java.
>
> You should also try to build a JDBC3 release at the same time.
>
> Kris Jurka

Whoops, should be better this time.

I will try to build a jdbc3 jar as soon as possible, probably Friday now

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca