You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A ConditionalCheckFailedException is thrown when updating an item that has a partition key attribute which uses DynamoDbAutoGeneratedUuid, and a version attribute using DynamoDbVersionAttribute.
If the DynamoDbAutoGeneratedUuid annotation is removed (and the partition key is populated manually) the issue doesn't occur.
Expected Behavior
I expected the item update to succeed.
Current Behavior
A ConditionalCheckFailedException is thrown from the update operation.
@johnchapin I can repro the issue. The problem is every time a DynamoDbAutoGeneratedUuid attribute is updated in the database, a new value is generated. This behavior was probably copied from the v1 DynamoDB Mapper, and v1 Mapper we had a separate annotation for keys - DynamoDBAutoGeneratedKey.
I think the path forward here is to add the equivalent of DynamoDBAutoGeneratedKey in the v2 DynamoDB Enhanced client. What do you think?
I think the path forward here is to add the equivalent of DynamoDBAutoGeneratedKey in the v2 DynamoDB Enhanced client. What do you think?
@debora-ito That would work for my use case - I discovered the issue when migrating code from the V1 mapper, so an equivalent of DynamoDbAutoGeneratedKey would be ideal.
Describe the bug
A
ConditionalCheckFailedException
is thrown when updating an item that has a partition key attribute which usesDynamoDbAutoGeneratedUuid
, and a version attribute usingDynamoDbVersionAttribute
.If the
DynamoDbAutoGeneratedUuid
annotation is removed (and the partition key is populated manually) the issue doesn't occur.Expected Behavior
I expected the item update to succeed.
Current Behavior
A
ConditionalCheckFailedException
is thrown from the update operation.Reproduction Steps
Here's the
DynamoDbBean
class:And here's the test code which produces the exception:
Possible Solution
No response
Additional Information/Context
Please let me know if this is actually expected behavior, or an unsupported usage of auto-generated UUIDs for partition keys.
AWS Java SDK version used
2.27.1
JDK version used
openjdk 21.0.3 2024-04-16 LTS
Operating System and version
macOS Sonoma 14.5 (23F79)
The text was updated successfully, but these errors were encountered: