Created with Raphaël 2.1.0
    Loading...

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This chapter describes considerations when integrating Altibase in Spring.

In order to process LOB data in ALTIBASE, the user must explicitly manage the transaction after changing the autocommit mode to false. Therefore, in order to process LOB in Spring, TransactionManager bean must be specified. In addition, when using a declarative transaction, propagation must be specified as one of PROPAGATION_REQUIRED, PROPAGATION_REQUIRES_NEW, and PROPAGATION_NESTED. 

If TrnasactionManager is not specified or propagation is set to a value other than above described when using the declarative transaction, a null value is returned when querying LOB data, or "java.sql.SQLException:0:LobLocator can not span the transaction 101858625." error will occur. In addition, when entering LOB data, "java.sql.SQLException0:LobLocator ca not span the transaction 101858625" error will occur.

Ex) applicationContext.xml file of LobConnection

Code Block
…
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
    <property name="dataSource" ref="dataSource"/>
</bean>
     
<bean id="txProxyTemplate" abstract="true"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
    <property name="transactionManager"  ref="transactionManager" />       
    <property name="transactionAttributes">
    <props>
        <prop key="get*">PROPAGATION_REQUIRED</prop>
        <prop key="add*">PROPAGATION_ REQUIRED </prop>
    </props>
    </property>
         
</bean>
 
<bean id="lobSampleService" parent="txProxyTemplate">
<property name="target">
         <bean class="com.altibase.lob.LobSampleService">
              <property name="lobSampleDao" ref="lobSampleDao"/>
         </bean>
    </property>
</bean>
…