Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Incorrect PostgreSQL's BLOB support in EclipseLink JPA (Incorrect PostgreSQL's BLOB support in EclipseLink JPA)
icon4.gif  Incorrect PostgreSQL's BLOB support in EclipseLink JPA [message #654596] Wed, 16 February 2011 07:58 Go to previous message
Michal Piotrowski is currently offline Michal Piotrowski
Messages: 6
Registered: February 2011
Junior Member
I would like to start a discussion about incorrect support for PostgreSQL's BLOBs in EclipsLink. There are 2 binary types in PotgreSQL: bytea and Blob. bytea is correctly supported in EclipseLink JPA, but Blob is not correctly implemented.

Blobs in PostgreSQL are linked into table columns as blob's OID number, so column type is OID. PostgreSQL driver returns for this column:
TYPE_NAME="oid"
DATA_TYPE=java.sql.Types.BIGINT

But it is possible to obtain Blob using ResultSet.getBlob() method.

EclipseLink thinks that blob column should be a java.lang.Long and can't read the blob. The result is that correctly annotated by @Lob PostgreSQL's blob columns can't be read.

I think that EclipseLink should read oid columns as Blob if they are annotated as @Lob. Is it possible, that this will be corrected in future versions of EclipseLink?

I would like to add, that when I tested Hibernate JPA some time ago, Hibernate expected serializable fields annotated with @Lob to be oids in PostgreSQL, and serializable fields without @Lob annotation to be bytea (java.sql.Types.BINARY). I think that this approach to PostgreSQL binary types should be treated as the correct one.

Michal Piotrowski
 
Read Message icon4.gif
Read Message
Read Message
Previous Topic:JPA 1.2 Overhead
Next Topic:double record in history
Goto Forum:
  


Current Time: Sat May 25 09:29:06 EDT 2013

Powered by FUDForum. Page generated in 0.01861 seconds