hi,
I've developed application using spring & IBatis. I'm using "DataSourceTransactionManager” as transaction manager for save operations in my aplication. Database is deployed on Informix ver. 7.3. And I'm using Tomcat 6 to deploy my application. My code works fine without transaction but as soon as i add transaction for save methods i get CannotCreateTransactionException transaction exception. Find below the log trace.
Spring Config:Code:org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: Transactions not supported Caused by: java.sql.SQLException: Transactions not supported at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:355) at com.informix.jdbc.IfxSqliConnect.setAutoCommit(IfxSqliConnect.java:1714) at org.apache.commons.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnection.java:268) at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.setAutoCommit(PoolingDataSource.java:293) at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:203) at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:349) at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:255) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:102) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210) at $Proxy1.getNewKey(Unknown Source)
What i'm doing wrong here? Am i missing any configuration?Code:<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="com.informix.jdbc.IfxDriver" /> <property name="url" value="jdbc:informix-sqli://23.343.341.23:1515/testdb:informixserver=ifxnew_den" /> <property name="username" value="testuser" /> <property name="password" value="password" /> </bean> <!-- Transaction manager for a single JDBC DataSource --> <bean id="transactionManagerTest" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource" /> <property name="transactionSynchronizationName" value="SYNCHRONIZATION_NEVER" /> </bean> <tx:advice id="txAdvice" transaction-manager="transactionManagerTest"> <tx:attributes> <tx:method name="saveData" read-only="false" /> </tx:attributes> </tx:advice> <aop:config> <aop: pointcut id="saveOperation" expression="execution(* com.test.ibatis.dao.*(..))" /> <aop:advisor advice-ref="txAdvice" pointcut-ref="saveOperation" /> </aop:config>
Does anyone have face this issue before? can someone help?
Thanks,
Bhavesh


Reply With Quote
