Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.hibernate4.LocalSessionFac toryBean doen't have "p:lobHandler-ref" property [SPR-9022] #13661

Closed
spring-issuemaster opened this issue Jan 12, 2012 · 1 comment

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented Jan 12, 2012

Maxim Kuzmik opened SPR-9022 and commented

Hello.

After merge for spring 3.1 and Hibernate 4. I can't do the work with Clob.

I have hbm file:

...
<property generated="never" lazy="false" name="hbmProperties" type="org.springframework.orm.hibernate3.support.ClobStringType">
...

In the package hibernate4.support.ClobStringType is absent.

And second one in the configuration i was have:
Code:

<bean id="sessionFactory"
        class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"
        p:dataSource-ref="asgePortalDataSource" p:lobHandler-ref="oracleLobHandler">
...
</bean>
<bean id="oracleLobHandler" class="org.springframework.jdbc.support.lob.OracleLobHandler"
        lazy-init="true">
        <property name="nativeJdbcExtractor">
            <ref local="nativeJdbcExtractor" />
        </property>
    </bean>

Now the org.springframework.orm.hibernate4.LocalSessionFac toryBean doen't have "p:lobHandler-ref" property.

What is the path to fix this?


Affects: 3.1 GA

Reference URL: http://forum.springsource.org/showthread.php?121101-Hibernate-4-logHandler-ClobStringType

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Jan 13, 2012

Juergen Hoeller commented

We generally rely on the native Hibernate 4 ways of doing things more than before (with Hibernate 3).

So for LOB access, we recommend native Hibernate types (e.g. org.hibernate.type.MaterializedClobType) instead of the former user types that came with Spring's Hibernate 3 support. With Hibernate 4 and modern JDBC drivers (e.g. Oracle 10g or even a JDBC 4 driver), you should not need Spring's LobHandler mechanism at all anymore.

In short, please try to replace your Spring user types with native Hibernate CLOB types. See the Hibernate documentation for details on their support for CLOB access.

Juergen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.