2 Replies Latest reply on Nov 7, 2005 1:09 PM by Brice Robert

    Re: setAutoCommit(false) in <local-tx-datasource>

    Nagaraj Davanagere Newbie

      Hi,

      I am trying to use a Managed Transaction from my java class as below,

      conn.setAutoCommit(false);

      The above line is throwing the exception,

      [STDOUT] java.sql.SQLException: You cannot set autocommit during a managed transaction!
      [STDOUT] at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.setJdbcAutoCommitBaseWrapperManagedConnection.java:46
      [STDOUT] at org.jboss.resource.adapter.jdbc.WrappedConnection.setAutoCommit(WrappedConnection.java:432)


      Kindly let me know how to manage the setAutoCommit with true/false values from my java class.

      I am using jboss-4.0.2 and also I have connection pool xml file contents as below,
      <local-tx-datasource>
      <connection-url>jdbc:oracle:thin:@172.16.1.71:1521:ttk</connection-url>
      <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
      <user-name>appln</user-name>
      appln
      </local-tx-datasource>


      Can we use setAutoCommit(false) in <local-tx-datasource> ?

      Please advice.



      regards,

      Nagaraj