Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-8551

JdbcStringBasedStore SQL Server upsert locks on data not key

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      The below code applies ON function to the data column, it should be the key column

               upsertRowSql = String.format("MERGE %1$s WITH (TABLOCK) " +
                           "USING (VALUES (?, ?, ?)) AS tmp (%2$s, %3$s, %4$s) " +
                           "ON (%1$s.%2$s = tmp.%2$s) " +
                           "WHEN MATCHED THEN UPDATE SET %3$s = tmp.%3$s, %4$s = tmp.%4$s " +
                           "WHEN NOT MATCHED THEN INSERT (%2$s, %3$s, %4$s) VALUES (tmp.%2$s, tmp.%3$s, tmp.%4$s);",
                     getTableName(), config.dataColumnName(), config.timestampColumnName(), config.idColumnName());
      

              Unassigned Unassigned
              remerson@redhat.com Ryan Emerson
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: