[hibernate-issues] [Hibernate-JIRA] Created: (HHH-6105) PostgreSQL problem when using @Lob on String field
Roelof Jan Koekoek (JIRA)
noreply at atlassian.com
Mon Apr 11 08:05:59 EDT 2011
PostgreSQL problem when using @Lob on String field
--------------------------------------------------
Key: HHH-6105
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6105
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.6.3, 3.6.2, 3.6.1, 3.6.0
Environment: postgresql:8.3-606.jdbc3
Reporter: Roelof Jan Koekoek
After upgrading from 3.5.6 to 3.6 we ran into issues using @Lob on String fields previously mapping to PostgreSQL's TEXT type. When loading these fields the PostgreSQL driver returns a:
"org.postgresql.util.PSQLException: Bad value for type long: Text content..."
The problem can be traced to Hibernates ClobTypeDescriptor which calls a resultSet.getClob("lobfield"). Apparently it expects an OID pointing to a clob and not the text field.
I found a lengthy discussion on this subject here:
http://groups.google.com/group/pgsql.interfaces.jdbc/browse_thread/thread/8385d700bf9ae6d1/0855172bb7ce5d43
At the bottom of the discussion a workaround is mentioned. Using @Type(type="org.hibernate.type.StringClobType") on the @Lob String fields gets things working as before, but this is a deprecated solution.
--
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