Open johnchapin opened 1 month ago
@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.
Marking this as a feature request.
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)