According to this post i changed my session factory definition from
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"
p:dataSource-ref="dataSource" p:lobHandler-ref="oracleLobHandler">
<property name="annotatedClasses">
<list>
[..]
into
<bean id="sessionFactory"
class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"
p:dataSource-ref="dataSource">
<property name="annotatedClasses">
<list>
[..]
Unfortunately there is no possibility to define the LobHandler as it was in hibernate3. As there is still the following written in the "Lobhandler"s javadoc it seems still necessary
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, is it still necessary to define the lobHandler in hibernate4 or not??? And if so, where can I define it?
It seems like you don't need it. They recommend using the native types as opposed to user types.
See http://www.sureshpw.com/2012/04/spring-hibernate-4.html.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With