Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VCR: fix MS SQL Server status list refresh #3457

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions vcr/revocation/statuslist2021_issuer.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func (cs *StatusList2021) Credential(ctx context.Context, issuerDID did.DID, pag
// Microsoft SQL server does not support the locking clause, so we have to use a raw query instead.
// See https://github.com/nuts-foundation/nuts-node/issues/3393
if tx.Dialector.Name() == "sqlserver" {
err = tx.Raw("SELECT * FROM status_list_entry WITH (UPDLOCK, ROWLOCK) WHERE subject_id = ?", statusListCredentialURL).
err = tx.Raw("SELECT * FROM status_list_credential WITH (UPDLOCK, ROWLOCK) WHERE subject_id = ?", statusListCredentialURL).
Scan(new(credentialRecord)).
Error
} else {
Expand Down Expand Up @@ -423,10 +423,9 @@ func (cs *StatusList2021) Revoke(ctx context.Context, credentialID ssi.URI, entr
// lock relevant credentialRecord. It was created when the first entry was issued for this StatusList2021Credential.
err = tx.Model(new(credentialRecord)).
Clauses(clause.Locking{Strength: clause.LockingStrengthUpdate}).
Select("count(*) > 0").
Group("subject_id").
Select("subject_id").
Where("subject_id = ?", entry.StatusListCredential).
Find(new([]bool)).
Find(new([]string)).
Error
if err != nil {
return err
Expand Down
Loading