Uploaded image for project: 'Hibernate ORM'
  1. HHH-10654

LockOptions.SKIP_LOCKED semantics implementation on MSSQL

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.3.11
    • Fix Version/s: 5.2.10
    • Component/s: hibernate-core
    • Labels:
      None
    • Environment:
      4.3.11, MSSQL

      Description

      I tried to use LockOptions with LockOptions.SKIP_LOCKED as a timeout value on MSSQL with Hibernate 4.3.11 but it seems it was ignored.

      As far as I checked, it is possible to have SKIP_LOCKED semantics with MSSQL using READPAST hint (see also https://msdn.microsoft.com/en-us/library/ms187373.aspx), for example:

      select 
          top 1 * 
      from my_table with (rowlock, updlock, readpast);
      

      Will return a first not locked row in my_table and will lock it at the same time.

        Attachments

          Activity

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: