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?
source share