Announcement Announcement Module
No announcement yet.
hibernate4 SessionFactory and LOBHandler Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • hibernate4 SessionFactory and LOBHandler

    I basically asked the same question already on stackoverflow, however without getting any answer till now.

    Summarizing it i had this configuration in Hibernate 3.6.8 (and Spring 3.1.0)
    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean" 
    p:dataSource-ref="dataSource" p:lobHandler-ref="oracleLobHandler">..</bean>
    Changing it into the following in hibernate 4
    <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean" 
    My problem right now is, that I miss the possibility of defining the lobhandler in this org.springframework.orm.hibernate4.LocalSessionFac toryBean, however in the javadoc of the lobhandler interface there is still the suggestion to use a specialized lobHandler.
    Summarizing the recommended options (for actual LOB fields):

    JDBC 4.0 driver: DefaultLobHandler with streamAsLob=true.
    PostgreSQL: DefaultLobHandler with wrapAsLob=true.
    Oracle 9i/10g: OracleLobHandler with a connection-pool-specific NativeJdbcExtractor.
    For all other database drivers (and for non-LOB fields that might potentially turn into LOBs on some databases): a plain DefaultLobHandler.
    So, my question is if this is still valid, and if so, where could it be defined?
    Last edited by hons; Jan 12th, 2012, 06:36 AM.

  • #2
    I have the same problem, when mirgation from Spring 3.0 and Hibernate 3.6.9 to Spring 3.1.1 and Hibernate 4.1.2.

    In class org.springframework.orm.hibernate4.LocalSessionFac toryBean the property for the lobHandler is missing.

    Is there any other way to define a LobHandler?