-
Notifications
You must be signed in to change notification settings - Fork 792
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
UpdateItemEnhancedRequest for null version number with ignoreNulls(true)
results into ConditionalCheckFailedException
#1985
Comments
@onkar27 I don't think version can be null by definition, once you start using it. The idea of having a version attribute is to make sure the version number on the server side has not changed since you retrieved the item. If the version does not match it means that the item was modified and you have a stale version. Specifying version = null and say to ignore it when you try to update the item defeats the purpose of optimistic locking. You should provide a version number before updating an item. So getting a |
Hi @debora-ito, you probably want to tag @onkar27 instead of me. |
Sorry for the confusion 😬 |
@debora-ito Thanks for reply, yeah I understand it when I'm reading for optimistic locking in dynamoDB. I think in the documentation of |
You can disable "Versioning" extension in mapper to bypass locking:
|
Support eventbridge MREP
Describe the issue
When we use
ignoreNulls(true)
feature while doingtable.updateItem
understanding that it will ignore all null fields to update it in db. But it looks like it's not working as expected for dynamo db version field, when my object contain all required fields like primary hash key, and sort key and version number as null, it's throwingConditionalCheckFailedException
.Steps to Reproduce
Where version number field is declared as below.
Current Behavior
It's throwing
ConditionalCheckFailedException
.Your Environment
The text was updated successfully, but these errors were encountered: