Hibernate4 & lobhandler

According to this post, I changed my factory session definition from

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean" p:dataSource-ref="dataSource" p:lobHandler-ref="oracleLobHandler"> <property name="annotatedClasses"> <list> [..] 

in

 <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean" p:dataSource-ref="dataSource"> <property name="annotatedClasses"> <list> [..] 

Unfortunately, there is no way to define LobHandler, as it was in hibernate3. Since the javadoc "Lobhandler" still says the following:

Summing up the recommended parameters (for real LOB fields):

  • JDBC 4.0 driver: DefaultLobHandler with streamAsLob = true.

  • PostgreSQL: DefaultLobHandler with wrapAsLob = true. Oracle 9i / 10g:

  • OracleLobHandler with NativeJdbcExtractor specific to the connection pool.

  • For all other database drivers (and for fields other than LOBs that could potentially turn into LOBs in some databases): Simple DefaultLobHandler.

So, it is still necessary to define lobHandler in hibernate4 or not ??? And if so, where can I identify it?

+4
source share
1 answer

You don't seem to need this. They recommend using native types, not user types.

See http://www.sureshpw.com/2012/04/spring-hibernate-4.html .

0
source

Source: https://habr.com/ru/post/1389039/


All Articles