I have a spring/jpa based application where all the beans are in default scope. I have services in jars.
When I use these in a spring batch application in multi-threaded way (using partitions ans AsyncTaskExecutors).
I am getting below exception
org.springframework.dao.CannotAcquireLockException: Deadlock found when trying to get lock; try restarting transaction; SQL [n/a]; nested exception is org.hibernate.exception.LockAcquisitionException: Deadlock found when trying to get lock; try restarting transaction
basically multiple threads are trying access a same entity.