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

NotSupportedException on a Patch #3261

Closed
Sinvit opened this issue Jun 14, 2024 · 2 comments
Closed

NotSupportedException on a Patch #3261

Sinvit opened this issue Jun 14, 2024 · 2 comments

Comments

@Sinvit
Copy link

Sinvit commented Jun 14, 2024

If to use numeric revision (UseNumericRevisions(true)) and execute Patch, what happens exception NotSupportedException.
As I understand it, this is because in RevisionColumn not imlemented method WriteMetadataInUpdateStatement and ShouldUpdatePartials=true.

What is the logic of using optimistic locking with revision anyway?

@Sinvit Sinvit changed the title NotImplementedException on a Patch NotSupportedException on a Patch Jun 14, 2024
@jeremydmiller
Copy link
Member

@Sinvit The optimistic concurrency logic is completely described in the documentation here:

https://martendb.io/documents/concurrency.html#numeric-revisioned-documents

And I need more information from you on what exactly your exception and bug was. Can you give us some repro steps for this? The description isn't really clear what you were trying to do exactly

@Sinvit
Copy link
Author

Sinvit commented Jun 16, 2024

  1. My DTO:
    class DocDto { public long Id { get; set; } public string Name { get; set; } public int Version { get; set; } }

  2. Mapping:
    For<DocDto>() .DocumentAlias(TableName) .DatabaseSchemaName(SchemaName) .Identity(d => d.Id) .GinIndexJsonData() .UseNumericRevisions(true) .MultiTenanted();

  3. When I execute:
    var patch = session.Patch<DocDto>(d => d.Id == id && d.AnyTenant()).Set("name", "newvalue");

happens exception NotSupportedException.
As I understand it, this is because in RevisionColumn not imlemented method WriteMetadataInUpdateStatement and ShouldUpdatePartials=true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants