Results 1 to 5 of 5

Thread: CannotCreateTransactionException

  1. #1
    Join Date
    Aug 2008
    Location
    India
    Posts
    23

    Question 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 6th, 2008 at 11:49 PM.

  2. #2
    Join Date
    Aug 2008
    Location
    India
    Posts
    23

    Talking

    Got the resolution.
    Database was not enable for handling transaction.

  3. #3
    Join Date
    Dec 2008
    Location
    India
    Posts
    8

    Default 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

  4. #4
    Join Date
    Aug 2008
    Location
    India
    Posts
    23

    Default

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

  5. #5
    Join Date
    Dec 2008
    Location
    India
    Posts
    8

    Default Informix guide

    Thank you bhavesh,

    Thank you for your reply...

    Issue got resolved..

    Thanks
    Mohan Reddy. M

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •