Skip to content

StoredCredential / AbstractDataStoreFactory - optimistic lock #401

@JWillow

Description

@JWillow

Is your feature request related to a problem? Please describe.

I'm facing to a concurrent requests that for the same user need to refresh the access token. All is good for the first request, but the second that uses the same refresh token has been rejected and in consequence, write null in the database. The access token and the new refresh are lost.

Describe the solution you'd like
Add a version field to the StoredCredential object. At this time this object cannot be overridden because it is declared as final class. This new field permit to implement a optimistic lock in my DataStoreFactory.
Result:
The second request it want to insert null with version 1, will be rejected because in database the first request put the new token with version 2. The right access token and refresh token aren't lost.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions