0 Replies Latest reply on Aug 27, 2010 4:38 AM by Daniel Winz

    Can't call rollback when autocommit=true

    Daniel Winz Newbie

      Hello,

       

      I always get warning

       

      2010-08-27 10:28:24,688 WARN  [org.jboss.resource.connectionmanager.TxConnectionManager] (http-127.0.0.1-8080-1) Connection error occured: ... 
      MySQLNonTransientConnectionException: Can't call rollback when autocommit=true ...
      

       

      together with warning

       

      2010-08-27 10:05:31,073 WARN  [org.jboss.resource.connectionmanager.TxConnectionManager] (http-127.0.0.1-8080-1) 
      Error during tidyup org.jboss.resource.connectionmanager.TxConnectionManager ...
      

       

      .

       

      Although I have switched autocommit off at persistence.xml

       

      <?xml version="1.0" encoding="UTF-8"?>
      <persistence version="1.0"
          xmlns="http://java.sun.com/xml/ns/persistence">
          <persistence-unit name="Employee-Details">
      
              <jta-data-source>java:/jdbc/employee</jta-data-source>
              <class>employee.EmployeeEntity</class>
      
              <properties>
                  
                  <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect" />
                  <property name="hibernate.show_sql" value="true" />
                  <property name="hibernate.format_sql" value="true" />    
                  
                  <property name="hibernate.connection.release_mode" value="after_statement" />
                  <property name="hibernate.connection.autocommit" value="false" />
                  
              </properties>
          </persistence-unit>
      </persistence>
      

       

      and datasource file:

       

      <?xml version="1.0" encoding="UTF-8"?>
      <!-- JBoss Server DataSource -->
      <datasources>
          <local-tx-datasource>
              <jndi-name>jdbc/employee</jndi-name>
              
              <connection-url>jdbc:mysql://localhost/employee</connection-url>
              <driver-class>com.mysql.jdbc.Driver</driver-class>
              <user-name>root</user-name>
              <password>root</password>
      
              <connection-property name="autoCommit">false</connection-property>
              <connection-property name="release_mode">after_statement</connection-property>
              
              <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
              <metadata>
                  <type-mapping>mySQL</type-mapping>
              </metadata>
      
         </local-tx-datasource>
      </datasources>
      

       

      Why JBOSS is still complaining? Where else I can configure autocommit?

       

      Daniel