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

    JSR 352 Implementation - Connection close problem on readers.



      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"
        <property name="emisor" value="#{jobParameters['emisor']}" />
        <property name="courier" value="#{jobParameters['courier']}" />
        <step id="FileXXXJob">
        <property name="emisor" value="#{partitionPlan['emisor']}" />
        <property name="courier" value="#{partitionPlan['courier']}" />
        <property name="fileName" value="#{partitionPlan['fileName']}" />
        <chunk item-count="5000">
        <reader ref="fileXXXReader" />
        <processor ref="fileXXXProcessor" />
        <writer ref="CVSFileWriter" />
        <mapper ref="fileXXXMapper" />


      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">
                          <new-connection-sql>select 1 from dual</new-connection-sql>


      Any help is welcome.