[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5659) Problem using Hibernate3.6.0.Final with CLOB field in Oracle.
Krzysztof Kowalczyk (JIRA)
noreply at atlassian.com
Mon Nov 15 12:24:15 EST 2010
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=39123#action_39123 ]
Krzysztof Kowalczyk commented on HHH-5659:
------------------------------------------
We have similar issue with PostgreSQL and sql text field that is mapped with @Lob to java string after moving to 3.6.0Final. Without @Type(type = "org.hibernate.type.StringClobType") Hibernate throwed exception:
Caused by: org.postgresql.util.PSQLException: Bad value for type long : 'a long string value...'
at org.postgresql.jdbc2.AbstractJdbc2ResultSet.toLong(AbstractJdbc2ResultSet.java:2737)
at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getLong(AbstractJdbc2ResultSet.java:2033)
at org.postgresql.jdbc3.Jdbc3ResultSet.getClob(Jdbc3ResultSet.java:43)
at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getClob(AbstractJdbc2ResultSet.java:387)
at com.mchange.v2.c3p0.impl.NewProxyResultSet.getClob(NewProxyResultSet.java:337)
at org.hibernate.type.descriptor.sql.ClobTypeDescriptor$2.doExtract(ClobTypeDescriptor.java:70)
at org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:64)
at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:253)
at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:249)
at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:229)
at org.hibernate.type.AbstractStandardBasicType.hydrate(AbstractStandardBasicType.java:330)
at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2265)
at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1527)
at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1455)
at org.hibernate.loader.Loader.getRow(Loader.java:1355)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:611)
at org.hibernate.loader.Loader.doQuery(Loader.java:829)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
at org.hibernate.loader.Loader.doList(Loader.java:2533)
... 14 more
> Problem using Hibernate3.6.0.Final with CLOB field in Oracle.
> -------------------------------------------------------------
>
> Key: HHH-5659
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5659
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.6.0
> Environment: Hibernate 3.6.0.Final, Database Oracle10G on Linux X64, and JPA
> Reporter: Samuel Rettore
> Priority: Minor
> Attachments: createClob_Deprecated.png, Hibernate_createClob_Deprecated.png, LobHelper_Interface.png, Srhlog.java
>
>
> When migrating my project that works well with Hibernate 3.5.6 End-to 3.6.0.Final the Clob field displays the following error
> |java.lang.ClassCastException: $Proxy1119 cannot be cast to oracle.sql.CLOB
> at oracle.jdbc.driver.OraclePreparedStatement.setClob(OraclePreparedStatement.java:7021)
> at org.hibernate.type.descriptor.sql.ClobTypeDescriptor$1.doBind(ClobTypeDescriptor.java:60)
> at org.hibernate.type.descriptor.sql.BasicBinder.bind(BasicBinder.java:89)
> at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:282)
> at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:277)
> at org.hibernate.type.AbstractSingleColumnStandardBasicType.nullSafeSet(AbstractSingleColumnStandardBasicType.java:85)
> at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2166)
> at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2412)
> at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2856)
> at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:79)
> at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)
> at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:265)
> at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:184)
> at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
> at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
> at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)
> at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:795)
> at com.sun.enterprise.container.common.impl.EntityManagerWrapper.flush(EntityManagerWrapper.java:407)
> ---
> This error appears only with CLOB field.
> to get more information at their disposal.
> Thanks
> Rettore.
--
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