pkainulainen / spring-batch-examples

Other
197 stars 286 forks source link

Spring Batch - Database row locked #1

Open jgeetha2k2 opened 5 years ago

jgeetha2k2 commented 5 years ago

I am using Spring Batch, my job is running in DEV environment and if i start the same job in my local, its hanging. Any idea would help on this issue.

georgevazj commented 5 years ago

Hi!

please, could you give us some details about the issue? Is your application showing some kind of error?

Regards,

jgeetha2k2 commented 5 years ago

I am not getting any exception. In my batch, below are the steps

  1. Reads data using FlatFileItemReader
  2. In Processor, get all the data from DB compares each row with the data fetched, if its equal(using equals and hashcode in entity) returning null else, I am updating the same entity with new values
  3. Writes to Database using Itemwriter

I am using Spring Boot, Spring Batch with JPARepository and C3P0 pooling

In one environment I have no issues, if I am running in DEV environment, in meanwhile if I am trying to run in my local getAllData() method is stuck, no exception for a long time. Then even if I stop the server its not working, I have to truncate table then only it works. Database is common in local and DEV. Any idea?