-
1. Re: JBeret / JSR352 - Should JdbcItemReader be used with jberet.local-tx?
jamezp Jan 23, 2015 4:55 PM (in response to xkylex)1 of 1 people found this helpfulAs I understand the issue the batch spec wants to do a lot of transactions. With JCA a JDBC resource is enlisted in the transaction when it's open and unenlisted when it's committed. Since batch commits the chunk after each open, read and write the JDBC needs to be opened in the read. What the jberet.local-tx=true property does is just uses a local transactions for the open, read and write. It's up to the ItemReader to determine when to commit the transaction.
The timing on this question is good though. I'm going to be meeting with the JCA team next week and see if we can figure out a better way to deal with this. I'm not too familiar with the JdbcItemReader, but at first glance it does appear the issue would show up if you were to use it.
I'm not sure if I actually answered your question or not Hopefully in a couple weeks I'll have a better answer and hopefully a better understanding.
--
James R. Perkins
-
2. Re: JBeret / JSR352 - Should JdbcItemReader be used with jberet.local-tx?
xkylex Jan 23, 2015 9:13 PM (in response to jamezp)As to the spec I have completely same understanding as you.
Also I'm curious why "ARJUNA016087: TransactionImple.delistResource - unknown resource" disappeared on WildFly 8.2.0.Final running the example app (https://www.dropbox.com/s/rl95nlmp4pu71c7/batch-test.zip). I can see ARJUNA016087 when I deploy it on WildFly 8.1.0.CR1. I suspect that is it made by chance or intended to fix the issue.
I'd appreciate if you give me some feedback about the issue after the meeting.
Note: I used following command to define xa-data-source.
xa-data-source add \
--name=IssuerXADS \
--driver-name=h2 \
--jndi-name=java:/ISSUER_DS \
--user-name=sa \
--password=sa \
--xa-datasource-properties={ \
"URL" => "jdbc:h2:mem:batchtest"}
Also I changed SQL grammar of File0591Reader.java to make it runnable on H2.
statement.execute("select '" + value + "' as value");
Thanks.
-
3. Re: JBeret / JSR352 - Should JdbcItemReader be used with jberet.local-tx?
jamezp Feb 26, 2015 2:16 PM (in response to xkylex)After talking with the transaction team it was determined the best solution would be to use a non-transactional data source for reads. It's likely not needed for reads anyway.
--
James R. Perkins
-
4. Re: JBeret / JSR352 - Should JdbcItemReader be used with jberet.local-tx?
xkylex Feb 26, 2015 7:10 PM (in response to jamezp)OK, I'd go with jberet.local-tx until the update of the JSR352 spec. thanks!
-
5. Re: JBeret / JSR352 - Should JdbcItemReader be used with jberet.local-tx?
xkylex Feb 28, 2015 9:14 PM (in response to xkylex)I guess I misunderstood that. we can simply use different datasource between ItemReader (jta=false) and ItemWriter as follows. in such case we don't need jberet.local-tx anymore. lbtc-xxx/jberet-support-jdbc-example · GitHub
-
6. Re: JBeret / JSR352 - Should JdbcItemReader be used with jberet.local-tx?
jamezp Mar 2, 2015 11:34 AM (in response to xkylex)1 of 1 people found this helpfulI think I led the misunderstanding as I was misunderstanding the issue as well But yes using a non-JTA data source for reads is the best option.
--
James R. Perkins