Hi devs,

I have a problem using streams under PostgreSQL 8.1. Fairly simple JPQL query like this:

   select i from Image i

Throws an exception:

<openjpa-1.3.0-SNAPSHOT-runknown nonfatal general error> org.apache.openjpa.persistence.PersistenceException: Bad value for type int : \001\002\003\004
        at 
org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4239)
at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4204)
...
Caused by: org.postgresql.util.PSQLException: Pogrešna vrednost za tip int : \001\002\003\004 at org.postgresql.jdbc2.AbstractJdbc2ResultSet.toInt(AbstractJdbc2ResultSet.java:2699) at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getInt(AbstractJdbc2ResultSet.java:2016) at org.apache.openjpa.lib.jdbc.DelegatingResultSet.getInt(DelegatingResultSet.java:134) at org.apache.openjpa.jdbc.sql.PostgresDictionary.getLOBStream(PostgresDictionary.java:338)
...


You can find Image.java in the attachment.

Before the exception there was a warning witch foreruns the exception:

16 magazinePu WARN [main] openjpa.MetaData - "magazine.model.Image.logo" declares a column "logo" whose JDBC type is not compatible with the expected type "integer".

Column logo is defined as BYTEA in PostgreSQL database, which is I beleive, correct. It is suspicious why the expected type is integer?

Configuration:
- OpenJPA 1.2.0 / OpenJPA 1.3.0 SNAPSHOT
- Enhancing at Build Time
- PostgreSQL 8.1.11

Regards,
Ognjen

Reply via email to