You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Patrick Linskey (JIRA)" <ji...@apache.org> on 2007/08/07 02:15:59 UTC

[jira] Created: (OPENJPA-308) Postgres: bytea vs. oid handling in PreparedStatement.setNull() calls

Postgres: bytea vs. oid handling in PreparedStatement.setNull() calls
---------------------------------------------------------------------

                 Key: OPENJPA-308
                 URL: https://issues.apache.org/jira/browse/OPENJPA-308
             Project: OpenJPA
          Issue Type: Bug
          Components: jdbc
    Affects Versions: 0.9.7, 0.9.6, 0.9.0
         Environment: Postgres 8.1 driver, Postgres 8.2 database
            Reporter: Patrick Linskey
             Fix For: 1.0.0


I'm seeing the following error when running against Postgres. This is solved by intercepting the DBDictionary.setNull() call and replacing Types.BLOB with Types.BINARY.


Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: ERROR: column "image" is of type bytea but expression is of type oid {prepstmnt 33517025 INSERT INTO LAZ_Product (id, image, name, price) VALUES (?, ?, ?, ?) [params=(long) 1186442009345, (null) null, (String) Browser Spiffer-Upper, (float) 31.5]} [code=0, state=42804]
at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:192)
at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$800(LoggingConnectionDecorator.java:57)
at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeUpdate(LoggingConnectionDecorator.java:858)
at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:269)
at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:269)
at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeUpdate(JDBCStoreManager.java:1363)
at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:95)
... 39 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-308) Postgres: bytea vs. oid handling in PreparedStatement.setNull() calls

Posted by "Vincent ASTRUC (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-308?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12580925#action_12580925 ] 

Vincent ASTRUC commented on OPENJPA-308:
----------------------------------------

I have this error with version 1.0.2 and Postgre 8.2 :

org.apache.openjpa.lib.jdbc.ReportingSQLException: ERROR: column "administrateddata" is of type bytea but expression is of type oid {prepstmnt 25070683 INSERT INTO USERS (OID, ADMINISTRATEDDATA, CLASSIFICATION, LOGIN, MODIFICATIONDATETIME, PASSWORD, PREFERENCES, PREFERENCESDATETIME, ROLE, JDOCLASS, JDOVERSION) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [params=(long) 1002865354472414137, (null) null, (null) null, (String) test, (null) null, (null) null, (null) null, (null) null, (String) Default, (String) com.thalesgroup.isr.common.mdd.TypeUsersImpl, (int) 1]} [code=0, state=42804]
	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:191)
	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$800(LoggingConnectionDecorator.java:56)
	at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeUpdate(LoggingConnectionDecorator.java:857)
	at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:269)
	at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:269)
	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeUpdate(JDBCStoreManager.java:1363)

> Postgres: bytea vs. oid handling in PreparedStatement.setNull() calls
> ---------------------------------------------------------------------
>
>                 Key: OPENJPA-308
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-308
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 0.9.0, 0.9.6, 0.9.7
>         Environment: Postgres 8.1 driver, Postgres 8.2 database
>            Reporter: Patrick Linskey
>             Fix For: 1.0.0
>
>
> I'm seeing the following error when running against Postgres. This is solved by intercepting the DBDictionary.setNull() call and replacing Types.BLOB with Types.BINARY.
> Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: ERROR: column "image" is of type bytea but expression is of type oid {prepstmnt 33517025 INSERT INTO LAZ_Product (id, image, name, price) VALUES (?, ?, ?, ?) [params=(long) 1186442009345, (null) null, (String) Browser Spiffer-Upper, (float) 31.5]} [code=0, state=42804]
> at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:192)
> at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$800(LoggingConnectionDecorator.java:57)
> at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeUpdate(LoggingConnectionDecorator.java:858)
> at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:269)
> at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:269)
> at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeUpdate(JDBCStoreManager.java:1363)
> at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:95)
> ... 39 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (OPENJPA-308) Postgres: bytea vs. oid handling in PreparedStatement.setNull() calls

Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-308?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Linskey resolved OPENJPA-308.
-------------------------------------

    Resolution: Fixed

> Postgres: bytea vs. oid handling in PreparedStatement.setNull() calls
> ---------------------------------------------------------------------
>
>                 Key: OPENJPA-308
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-308
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>    Affects Versions: 0.9.0, 0.9.6, 0.9.7
>         Environment: Postgres 8.1 driver, Postgres 8.2 database
>            Reporter: Patrick Linskey
>             Fix For: 1.0.0
>
>
> I'm seeing the following error when running against Postgres. This is solved by intercepting the DBDictionary.setNull() call and replacing Types.BLOB with Types.BINARY.
> Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: ERROR: column "image" is of type bytea but expression is of type oid {prepstmnt 33517025 INSERT INTO LAZ_Product (id, image, name, price) VALUES (?, ?, ?, ?) [params=(long) 1186442009345, (null) null, (String) Browser Spiffer-Upper, (float) 31.5]} [code=0, state=42804]
> at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:192)
> at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$800(LoggingConnectionDecorator.java:57)
> at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeUpdate(LoggingConnectionDecorator.java:858)
> at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:269)
> at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:269)
> at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeUpdate(JDBCStoreManager.java:1363)
> at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:95)
> ... 39 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.