6 Replies Latest reply on Mar 2, 2015 11:34 AM by jamezp

    JBeret / JSR352 - Should JdbcItemReader be used with jberet.local-tx?

    xkylex

      In my understanding, each open, read, write and close of every JDBC resources (Connection, Statement and ResultSet) needs to be in it's own transaction. however, JdbcItemReader opens Connection, Statement and ResultSet in ItemReader#open(), then closes every resources in ItemReader#close(). it uses these resources across multiple transaction.

       

      https://github.com/jberet/jsr352/blob/master/jberet-support/src/main/java/org/jberet/support/io/JdbcItemReader.java

       

      According to following discussion, it seems like violates the spec of JCA or something and encouraged to use "jberet.local-tx" to handle transactions manually as a workaround for a while.

       

      https://developer.jboss.org/message/863072

      https://issues.jboss.org/browse/WFLY-3135

       

      Also I checked a documentation of JdbcItemReader but there's no mention of jberet.local-tx or the problem about handling of JDBC resources across multiple transaction.

       

      https://github.com/jberet/jberet-user-guide/tree/master/read_and_write_data_through_jdbc

       

      So should I JdbcItemReader use with jberet.local-tx? or am I misunderstood something?

       

      Thanks.