Announcement Announcement Module
Collapse
No announcement yet.
CannotCreateTransactionException Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • CannotCreateTransactionException

    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.
    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)
    Spring Config:
    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>
        
    What i'm doing wrong here? Am i missing any configuration?
    Does anyone have face this issue before? can someone help?

    Thanks,
    Bhavesh
    Last edited by bhavesh_feb; Aug 7th, 2008, 12:49 AM.

  • #2
    Got the resolution.
    Database was not enable for handling transaction.

    Comment


    • #3
      Enabling Transaction in informix DB

      Hi Bhavesh,
      I got the same exception which I am using informix DB for my project.
      Please let me know How to enable the transaction handling in informix
      Data base??

      Thanks in Advance
      Mohan Redddy. M

      Comment


      • #4
        You can refer informix guide to turn on transactions.
        See if this helps:
        http://publib.boulder.ibm.com/infoce...oc/sqls173.htm

        Comment


        • #5
          Informix guide

          Thank you bhavesh,

          Thank you for your reply...

          Issue got resolved..

          Thanks
          Mohan Reddy. M

          Comment

          Working...
          X