Closed hn310 closed 7 years ago
This is a database level deadlock. Have you tried using a different database other than Derby?
This read/write process to Derby database is invoked by JEE7 Batch itself. I'm not actively connecting to this database (as you can see from my code above). For this reason, how can I try using a different type of database?
Derby is just the default database used to store details of the batch jobs. It is not recommended to be used in production. Payara supports different databases like MySQL, PostGres etc. as an alternative to Derby see https://payara.gitbooks.io/payara-server/content/documentation/extended-documentation/jbatch.html.
Can you put your test application on GitHub so we can investigate?
@smillidge : Thank you, after I changed the database to Oracle, everything went well. By the way, when running batch in multiple threads, is there any limit to the number of threads, or a formula to calculate maximum number of threads?
Good to know.
JBatch uses a configured executor service for managing threads. You can see which executor service you are using in the administration console when configuring JBatch. Therefore you can configure how many threads you need by configuring the executor service.
I'm trying to run JAVAEE7 batch on multithread using partition. My batch is simple: read a bunch of random numbers, write out the sum of them using 3 threads.
My Job XML
My PartitionMapperImpl:
My Reader:
My Processor
My Writer
When I run this batch, the following error occured. I'm guessing this has something to do with storing serveral checkpoints at them same time in the derby database.
Do you have any ideas how to fix this? Or any sample which can run on more than 2 threads is really helpful. Thanks in advance.