13 Replies Latest reply on Mar 27, 2014 12:09 PM by James Perkins

    JSR 352 Implementation - Connection close problem on readers.

    fenoloco Newbie

      Hi,

      I'm evaluating the possibility of use the wildfly´s JSR 352 implementation.

      The job.xml looks like this.


      <?xml version="1.0" encoding="UTF-8"?>
      <job id="job0001" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/jobXML_1_0.xsd"
        version="1.0">
        <properties>
        <property name="emisor" value="#{jobParameters['emisor']}" />
        <property name="courier" value="#{jobParameters['courier']}" />
        </properties>
      
        <step id="FileXXXJob">
        <properties>
        <property name="emisor" value="#{partitionPlan['emisor']}" />
        <property name="courier" value="#{partitionPlan['courier']}" />
        <property name="fileName" value="#{partitionPlan['fileName']}" />
        </properties>
      
        <chunk item-count="5000">
        <reader ref="fileXXXReader" />
        <processor ref="fileXXXProcessor" />
        <writer ref="CVSFileWriter" />
        </chunk>
        <partition>
        <mapper ref="fileXXXMapper" />
        </partition>
        </step>
      </job>
      

       

      The Readers reads the data from a DB and the writer writes it on a CVS File, but I have 2 problems.


      1) The close method on the Reader is called twice.

      2) When I close the sql connection the next warning appears on the log. Take in account that this warnings are throw on the first attempt to close the connection and it not related with the point 1.

       

      WARN  [com.arjuna.ats.jta] (batch-batch - 2) ARJUNA016087: TransactionImple.delistResource - unknown resource
      

       

      I also have a mapper that use the same connection and the db connection works as expected. The DS is defined in this way.

       

      <datasource jta="true" jndi-name="java:/XXXX_DS" pool-name="XXXX_DS" enabled="true" use-ccm="false">
                          <connection-url>jdbc:oracle:thin:@xx.64.xx.237:1521:xxxxxx</connection-url>
                          <driver-class>oracle.jdbc.OracleDriver</driver-class>                  
                          <driver>oracle</driver>
                          <new-connection-sql>select 1 from dual</new-connection-sql>
                          <pool>
                              <min-pool-size>1</min-pool-size>
                              <max-pool-size>30</max-pool-size>
                              <use-strict-min>true</use-strict-min>
                          </pool>
                          <security>
                              <user-name>xxxxxx</user-name>
                              <password>${VAULT::XXXXXX::password::1}</password>
                          </security>
                          <validation>
                              <validate-on-match>false</validate-on-match>
                              <background-validation>false</background-validation>
                          </validation>
                          <statement>
                              <track-statements>true</track-statements>
                              <share-prepared-statements>false</share-prepared-statements>
                          </statement>
      </datasource>
      

       

      Any help is welcome.

      Thanks.