Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-16886

SqlServerMaxValueIncrementer variant based on MS SQL sequences (avoiding deadlocks)

    XMLWordPrintable

Details

    • true

    Description

      We are currently refactoring a legacy scheduler application to use spring cloud data flow and spring cloud task. The tasks are mostly spring batch applications and we have been encountering deadlock issues in the batch meta tables when using MS SQL Server.

      Digging into this a bit further, we discovered our issue related to the the strategy being used for sequences and there is already an issue in Spring Batch.

      The use of a sequence table (likely because older versions of SQL Server didn't have support for sequences) and the strategy to delete records from that table result in deadlocks.

      We were able to work around this issue by customizing the creation of the Job repository such that a custom Incrementer is installed that uses sequences instead.

      So, why are we filing this issue here?

      We realized we are likely to have the same issue in Spring Cloud Task's meta-tables. We had to do some more Spring gymnastics to override the Incrementer there, it was not as easy as Spring Batch, but we managed.

      We also need to make sure Spring Cloud Data Flow is using the same incrementer and that is even harder to override......

      All of these issues lead back to need for a better strategy for getting max values when using MS SQL Server.

       

      Attachments

        Activity

          People

            juergen.hoeller Juergen Hoeller
            tkvangorder Tyler K Van Gorder
            Spring Issues Spring Issues
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              3 years, 47 weeks, 2 days ago