We're updating the issue view to help you get more done. 

Sybase jConnect driver cannot use ResultSet.getClob(String) method

Description

When using @Lob on a String-typed attribute, with a column of type text in database, I get this while fetching data (the french exception message says something like "the SybResultSet.getClob(String) method is not supported and should not have been called."):

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 java.lang.UnsupportedOperationException: La méthode com.sybase.jdbc4.jdbc.SybResultSet.getClob(String) n'est pas supportée et n'aurait pas dû être appelée. at com.sybase.jdbc4.jdbc.ErrorMessage.raiseRuntimeException(Unknown Source) ~[jconn4.jar:na] at com.sybase.jdbc4.utils.Debug.notSupported(Unknown Source) ~[jconn4.jar:na] at com.sybase.jdbc4.jdbc.SybResultSet.getClob(Unknown Source) ~[jconn4.jar:na] at org.apache.tomcat.dbcp.dbcp.DelegatingResultSet.getClob(DelegatingResultSet.java:568) ~[tomcat-dbcp.jar:7.0.14] at org.apache.tomcat.dbcp.dbcp.DelegatingResultSet.getClob(DelegatingResultSet.java:568) ~[tomcat-dbcp.jar:7.0.14] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_30] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[na:1.6.0_30] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_30] at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_30] at org.hibernate.engine.jdbc.internal.proxy.AbstractResultSetProxyHandler.continueInvocation(AbstractResultSetProxyHandler.java:104) ~[hibernate-core-4.1.9.Final.jar:4.1.9.Final] at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81) ~[hibernate-core-4.1.9.Final.jar:4.1.9.Final] at $Proxy128.getClob(Unknown Source) ~[na:na] at org.hibernate.type.descriptor.sql.ClobTypeDescriptor$4.doExtract(ClobTypeDescriptor.java:108) ~[hibernate-core-4.1.9.Final.jar:4.1.9.Final] at org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:65) ~[hibernate-core-4.1.9.Final.jar:4.1.9.Final] at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:261) ~[hibernate-core-4.1.9.Final.jar:4.1.9.Final] at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:257) ~[hibernate-core-4.1.9.Final.jar:4.1.9.Final] at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:247) ~[hibernate-core-4.1.9.Final.jar:4.1.9.Final] at org.hibernate.type.AbstractStandardBasicType.hydrate(AbstractStandardBasicType.java:332) ~[hibernate-core-4.1.9.Final.jar:4.1.9.Final] at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2873) ~[hibernate-core-4.1.9.Final.jar:4.1.9.Final]

Note: I'm currently migrating from Hibernate 3.5.3-Final to 4.1.9.Final, and everything was working fine before the upgrade. Migration guides didn't tell much about LOBs, so I changed nothing @Lob-related in my code/mapping.

As the HibernateCoreMigrationGuide36 wiki page suggested for other database systems, I tried leveraging the hibernate.jdbc.use_streams_for_binary configuration parameter, but to no avail.

This issue may be related to HHH-3691 or HHH-3892.

Environment

Hibernate 4.1.9.Final Sybase ASE 15.5 (driver: jConnect)

Status

Assignee

Brett Meyer

Reporter

Vincent Cornet

Components

Fix versions

Affects versions

4.1.9

Priority

Major