title: jboss eap workaround default setting connection: autocommit = true
body: <p>I'm working on a websphere 6.1 migration to jboss EAP 6.3. I find that the deployment process is very simple in jboss content that my old server contains only wars.</p>
  
  <p>the configuration of shared libraries has passed without problem, but the problem is with the configuration of datasources a java.sql.SQLException error: You can not commit with autocommit set! block passage.</p>
  
  <p>I searched on google most say that this is the standard, and that we must change the code to setAutoCommit (Fasle).</p>
  
  <p>But in my case, in order that this passage is transparent for developers or with minimal change, I can't change the war. The area of my intervention are application server only.</p>
  
  <p>Below configuration file standalone.xml:</p>
  
  <p>thank you for guiding me if another issue that deals with the same problem, I have not found a similar problem. even if it is something elementary in my opinion !!</p>
  
  <p><a href="https://stackoverflow.com/questions/20973437/prevent-oracle-connection-autocommit-for-jndi-datasource-on-jboss-7-jeeves-dbms">Similar questions but need more detail</a></p>
  
  <p>Any ideas please ?</p>
  
  <pre><code>&lt;datasource jta="true" jndi-name="java:/jdbc/XXXXPool" pool-name="XXXXPool" enabled="true" use-ccm="true"&gt;
      &lt;connection-url&gt;jdbc:oracle:thin:@xxxxxxxxx:1521:xxx&lt;/connection-url&gt;
      &lt;driver-class&gt;oracle.jdbc.OracleDriver&lt;/driver-class&gt;
      &lt;datasource-class&gt;oracle.jdbc.pool.OracleConnectionPoolDataSource&lt;/datasource-class&gt;
      &lt;connection-property name="autoCommit"&gt; &lt;!-- not working --&gt;
          false
      &lt;/connection-property&gt;
      &lt;driver&gt;OracleJDBCDriver&lt;/driver&gt;
      &lt;transaction-isolation&gt;TRANSACTION_READ_COMMITTED&lt;/transaction-isolation&gt;
      &lt;security&gt;
          &lt;user-name&gt;xx&lt;/user-name&gt;
          &lt;password&gt;&lt;/password&gt;
      &lt;/security&gt;
      &lt;validation&gt;
          &lt;validate-on-match&gt;false&lt;/validate-on-match&gt;
          &lt;background-validation&gt;false&lt;/background-validation&gt;
      &lt;/validation&gt;
      &lt;timeout&gt;
          &lt;set-tx-query-timeout&gt;false&lt;/set-tx-query-timeout&gt;
          &lt;blocking-timeout-millis&gt;0&lt;/blocking-timeout-millis&gt;
          &lt;idle-timeout-minutes&gt;0&lt;/idle-timeout-minutes&gt;
          &lt;query-timeout&gt;0&lt;/query-timeout&gt;
          &lt;use-try-lock&gt;0&lt;/use-try-lock&gt;
          &lt;allocation-retry&gt;0&lt;/allocation-retry&gt;
         &lt;allocation-retry-wait-millis&gt;0&lt;/allocation-retry-wait-millis&gt;
      &lt;/timeout&gt;
      &lt;statement&gt;
          &lt;share-prepared-statements&gt;false&lt;/share-prepared-statements&gt;
      &lt;/statement&gt;
  &lt;/datasource&gt;
  &lt;drivers&gt;
      &lt;driver name="OracleJDBCDriver" module="oracle.jdbc"/&gt;
      &lt;driver name="h2" module="com.h2database.h2"&gt;
          &lt;xa-datasource-class&gt;org.h2.jdbcx.JdbcDataSource&lt;/xa-datasource-class&gt;
      &lt;/driver&gt;
  &lt;/drivers&gt;
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>java.sql.SQLException: You cannot commit with autocommit set!
  
  16:38:40,205 ERROR [stderr] (http-/xxx.xx.xx.xx:8080-1)         at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.jdbcCommit(BaseWrapperManagedConnection.java:1071)
  
  16:38:40,206 ERROR [stderr] (http-/xxx.xx.xx.xx:8080-1)         at org.jboss.jca.adapters.jdbc.WrappedConnection.commit(WrappedConnection.java:758)
  
  16:38:40,206 ERROR [stderr] (http-/xxx.xx.xx.xx:8080-1)         at com.client.Series.utiles.UserUtilesClass.checkUser(UserUtilesClass.java:370)
  
  16:38:40,206 ERROR [stderr] (http-/xxx.xx.xx.xx:8080-1)         at com.client.Series.form.LoginForm.validate(LoginForm.java:65)
  
  16:38:40,206 ERROR [stderr] (http-/xxx.xx.xx.xx:8080-1)         at org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:942)
  
  16:38:40,206 ERROR [stderr] (http-/xxx.xx.xx.xx:8080-1)         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:255)
  
  16:38:40,207 ERROR [stderr] (http-/xxx.xx.xx.xx:8080-1)         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
  
  16:38:40,207 ERROR [stderr] (http-/xxx.xx.xx.xx:8080-1)         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
  
  16:38:40,207 ERROR [stderr] (http-/xxx.xx.xx.xx:8080-1)         at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
  
  16:38:40,207 ERROR [stderr] (http-/xxx.xx.xx.xx:8080-1)         at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
  
  16:38:40,208 ERROR [stderr] (http-/xxx.xx.xx.xx:8080-1)         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)
  
  16:38:40,208 ERROR [stderr] (http-/xxx.xx.xx.xx:8080-1)         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
  
  16:38:40,208 ERROR [stderr] (http-/xxx.xx.xx.xx:8080-1)         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231)
  
  16:38:40,208 ERROR [stderr] (http-/xxx.xx.xx.xx:8080-1)         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149)
  
  16:38:40,209 ERROR [stderr] (http-/xxx.xx.xx.xx:8080-1)         at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)
  
  16:38:40,209 ERROR [stderr] (http-/xxx.xx.xx.xx:8080-1)         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145)
  
  16:38:40,209 ERROR [stderr] (http-/xxx.xx.xx.xx:8080-1)         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)
  
  16:38:40,209 ERROR [stderr] (http-/xxx.xx.xx.xx:8080-1)         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)
  
  16:38:40,209 ERROR [stderr] (http-/xxx.xx.xx.xx:8080-1)         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344)
  
  16:38:40,210 ERROR [stderr] (http-/xxx.xx.xx.xx:8080-1)         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
  
  16:38:40,210 ERROR [stderr] (http-/xxx.xx.xx.xx:8080-1)         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)
  
  16:38:40,210 ERROR [stderr] (http-/xxx.xx.xx.xx:8080-1)         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926)
  
  16:38:40,211 ERROR [stderr] (http-/xxx.xx.xx.xx:8080-1)         at java.lang.Thread.run(Unknown Source)
  </code></pre>