Announcement Announcement Module
No announcement yet.
Transaction manager with In-Memory Derby JobRepository + MySQL DB for data Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Are you sure about that? The stack trace you posted shows the exception being thrown in commit (not in anotherDao). It is a sign that you are working concurrently with the same items in another process or thread. Does that sound plausible? Or maybe the implementation of anotherDao needs some investigation. Can you run the ItemWriter on its own in an integration test, simulating the conditions in the Batch job, but without any Batch?

    JPA writers should flush at the end of write() or via an ItemWriteListener.


    • #17
      The first OptimisticLockingException (org.eclipse.persistence.exceptions.OptimisticLock E xception
      Exception Description: The object [email protected] cannot be updated because it has changed or been deleted since it was last read. ) happening in my app is actually expected, as the table.View is being concurrently updated from several threads.
      I would think though that it shouldn't cause the OptimisticLockingException in Spring Batch (#AbstractStep # Encountered an error saving batch meta data. This job is now in an unknown state and should not be restarted.
      org.springframework.dao.OptimisticLockingFailureEx ception: Attempt to update step execution id=4 with wrong version (1), where current version is 2)