[hibernate-issues] [Hibernate-JIRA] Reopened: (HHH-4617) Using blobs with hibernate causes error

Gail Badner (JIRA) noreply at atlassian.com
Fri Dec 24 01:07:05 EST 2010


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4617?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gail Badner reopened HHH-4617:
------------------------------


I am still seeing this in 3.6 with hibernate.jdbc.use_streams_for_binary=false.

I'm getting org.postgresql.util.PSQLException: ERROR: column "long_byte_array" is of type oid but expression is of type bytea.

A possible fix is to:
1) add Dialect.useLobForMaterializedLobBinding(); it can default to false; PostgreSQLDialect can override it to return true.
2) add WrapperOptions.useLobForMaterializedLobBinding(); it can be defined to return session.getFactory().getDialect().useLobForMaterializedLobBinding().
3) change doBind(...) in BlobTypeDescriptor.getBinder(...) to create and bind a Blob for byte[] values, if options.useLobForMaterializedLobBinding() is true.

Steve, how does that sound?

> Using blobs with hibernate causes error
> ---------------------------------------
>
>                 Key: HHH-4617
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4617
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.5.0-Beta-2, 3.6.0
>         Environment: Hibernate 3.5-b2, Glassfish v3 promoted build 74, PostgreSQL 8.3.7
>            Reporter: Radosław Smogura
>            Assignee: Gail Badner
>            Priority: Critical
>
> I have entity with byte[] property annotated as @Lob and lazy fetch type, when table is createad the created column is of type oid, but when the column is read in application, the Hibernate reads the OID value instead of bytes under given oid. It's behavior like to read / write bytea.
> If i remember well, auto-creating table with Hibernate creates oid column.
> The proper behavior for dealing in PostgreSQL (and this behavior is in Hibernate 3.4) is to use oids.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the hibernate-issues mailing list