0 Replies Latest reply on Jan 12, 2013 3:34 PM by martian

    JBoss 5.1.0 datasource configuration "autocommit"

    martian

      I have a question regarding the datasource configuration in JBoss 5.1.0. I have a XA datasource configured using Oracle 11g as the database. The ojdbc6.jar has been copied over into the servers "lib" folder. I'm able to get the connection successfully but the "autocommit" for it seems to be set to "true". Is this by design?

       

      The way it exhibits itself is, when we are running a spring batch job that uses a cursor based item reader, after the first commit by the framework (for the writer), the cursor loses its position. I can see Spring batch is trying to open the cursor using FOR READ but that doesn't seem to make a difference. On digging into it, it seems like setting the "autocommit" to "false" on the connection would help. I just can't seem to find any documentation on how to do this for a XA connection.

       

      Usual suspects like settings <xa-datasource-property name="autoCommit">false</xa-datasource-property> doesn't work. Any ideas? Would really appreciate any pointers ....

       


      <xa-datasource>                                                                                                                                                           

      <jndi-name>oracleDB</jndi-name>                                                                                                                                     

      <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>                                                                                   



      <xa-datasource-property name="DatabaseName">abc</xa-datasource-property>

      <xa-datasource-property name="User">user</xa-datasource-property>

      <xa-datasource-property name="Password">password</xa-datasource-property>




      <xa-datasource-property name="PortNumber">1521</xa-datasource-property>

      <xa-datasource-property name="DriverType">4</xa-datasource-property>

      <xa-datasource-property name="ServerName">127.0.0.1</xa-datasource-property>



      <xa-datasource-property name="URL">jdbc:oracle:thin:@localhost:1521:abc</xa-datasource-property>                                                               



        <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>

      <track-connection-by-tx/>   

      <isSameRM-override-value>false</isSameRM-override-value>



      <metadata>                                                                                                                                                            

      <type-mapping>Oracle11g</type-mapping>                                                                                                                         

      </metadata>                                                                                                                                                           

      </xa-datasource>