Announcement Announcement Module
Collapse
No announcement yet.
Spring 1.2RC2, ClobStringType, & Hibernate3 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring 1.2RC2, ClobStringType, & Hibernate3

    There are some examples out there about using the ClobStringType but I'm having some issues. Here is my setup:

    Spring 1.2RC2, Hibernate3, Oracle 8.1.7 (groan)

    MAPPING
    <set name="notes" table="product_notes" cascade="all">
    <key column="prd_id" />
    <composite-element
    class="ProductNote">
    <many-to-one name="noteType" column="note_id" />
    <property name="text" column="TEXT" type="org.springframework.orm.hibernate3.support.C lobStringType" />
    </composite-element>
    </set>

    Where column 'text' is type CLOB

    DB Properties
    database.driver=oracle.jdbc.driver.OracleDriver
    database.validationQuery=SELECT SYSDATE FROM DUAL
    hibernate.dialect=org.hibernate.dialect.OracleDial ect


    applicationContext.xml:

    <bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSess ionFactoryBean">
    <property name="dataSource"><ref bean="dataSource"/></property>
    <property name="lobHandler"><ref bean="oracleLobHandler"/></property>
    <property name="mappingResources">
    <list>
    <value>mappingfile.hbm.xml</value>
    </list>
    </property>


    <!-- NativeJdbcExtractor -->
    <bean id="nativeJdbcExtractor" class="org.springframework.jdbc.support.nativejdbc .CommonsDbcpNativeJdbcExtractor" lazy-init="true"/>

    <!-- LobHandler for Oracle JDBC drivers -->
    <bean id="oracleLobHandler" class="org.springframework.jdbc.support.lob.Oracle LobHandler" lazy-init="true">
    <property name="nativeJdbcExtractor"><ref local="nativeJdbcExtractor"/></property>
    </bean>


    Partial stack trace:

    12:02:03 WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 932, SQLState: 42000
    12:02:03 ERROR org.hibernate.util.JDBCExceptionReporter - ORA-00932: inconsistent datatypes

    12:02:03 WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 932, SQLState: 42000
    12:02:03 ERROR org.hibernate.util.JDBCExceptionReporter - ORA-00932: inconsistent datatypes

    12:02:03 ERROR org.hibernate.event.def.AbstractFlushingEventListe ner - Could not synchronize database state with session
    org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
    at org.hibernate.exception.ErrorCodeConverter.handled NonSpecificException(ErrorCodeConverter.java:92)
    at org.hibernate.exception.ErrorCodeConverter.convert (ErrorCodeConverter.java:80)
    at org.hibernate.exception.JDBCExceptionHelper.conver t(JDBCExceptionHelper.java:43)
    at org.hibernate.jdbc.AbstractBatcher.executeBatch(Ab stractBatcher.java:179)
    at org.hibernate.jdbc.AbstractBatcher.prepareStatemen t(AbstractBatcher.java:72)
    at org.hibernate.jdbc.AbstractBatcher.prepareStatemen t(AbstractBatcher.java:67)
    at org.hibernate.jdbc.AbstractBatcher.prepareBatchSta tement(AbstractBatcher.java:148)
    at org.hibernate.persister.collection.AbstractCollect ionPersister.insertRows(AbstractCollectionPersiste r.java:1032)
    at org.hibernate.action.CollectionUpdateAction.execut e(CollectionUpdateAction.java:48)
Working...
X