0 Replies Latest reply on Sep 21, 2015 6:00 AM by Bharath Polanki

    Optional autocommit available?

    Bharath Polanki Newbie

      Hi,

       

       

      I have an application which is currently running in glassfish server  with autocommit as true. In some areas my application is explicitly calling connection.commit() and few places no connection.commit() is called. So when there is no connection.commit() is called autocommit comes into picture and commits the transaction. When connection.commit() is called explicitly the transaction takes place as usual without error saying autocommit is set do not commit explicitly.

       

       

      My worry is: Now we are migrating to Jboss, how can I achieve above said situations by using JBOSS. When I deploy application in JBOSS now I am facing issues when I do call connection.commit() explicitly error message :

      java.sql.SQLException: You cannot commit with autocommit set!

       

       

      Here is my configuration currently what I have in domain.xml. My server version is Jboss 6.4.1.

       

       

      <datasource jta="true" jndi-name="XYZ/datasource" pool-name="SybaseConnectionPool" enabled="true" use-ccm="true" statistics-enabled="false">                       

      <connection-url>server url here</connection-url>

                              <connection-property name="charset">

                                  utf8

                              </connection-property>

                              <driver>BRSybase</driver>

                              <pool>

                                  <min-pool-size>25</min-pool-size>

                                  <max-pool-size>225</max-pool-size>

                                  <prefill>true</prefill>

                                  <flush-strategy>FailingConnectionOnly</flush-strategy>

                              </pool>

                              <security>

                                  <user-name>username</user-name>

                                  <password>password</password>

                              </security>

                              <validation>

                                  <validate-on-match>false</validate-on-match>

                                  <background-validation>false</background-validation>

                              </validation>

                              <timeout>

                                  <set-tx-query-timeout>false</set-tx-query-timeout>

                                  <blocking-timeout-millis>0</blocking-timeout-millis>

                                  <idle-timeout-minutes>5</idle-timeout-minutes>

                                  <query-timeout>0</query-timeout>

                                  <use-try-lock>0</use-try-lock>

                                  <allocation-retry>0</allocation-retry>

                                  <allocation-retry-wait-millis>0</allocation-retry-wait-millis>

                              </timeout>

                              <statement>

                                  <track-statements>false</track-statements>

                                  <share-prepared-statements>false</share-prepared-statements>

                              </statement>

                          </datasource>

       

       

       

       

       

       

      A help here is really appreciated. Kindly let me know any information required from my end which you feel missing.Thanks in advance.