openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ignacio Andreu" <plunch...@gmail.com>
Subject Re: Problem with streaming support on PostgreSQL
Date Wed, 03 Sep 2008 13:55:41 GMT
Hi Ognjen,
Apache OpenJPA doesn't expect an integer is a problem with Postgres. This
problem happens when you try to stream binary data in a bytea column, for
this reason I used the specific table pg_largeobject and the
LargeObjectManager to manage the binary objects in the streaming LOB
support. Can you send you entity? (is no attached in the e-mail).

Thanks,

2008/9/3 Ognjen Blagojevic <ognjen@etf.bg.ac.yu>

> 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
>
>
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message