dynalite icon indicating copy to clipboard operation
dynalite copied to clipboard

Optimistic locking not supported by Dynalite

Open sateeshampolu opened this issue 6 years ago • 3 comments

Does Dynalite support optimistic locking?

I have an integration test to prove that optimistic locking works . It work fine when running it with DynamoDb local but fails when using Dynalite.

sateeshampolu avatar Dec 02 '19 12:12 sateeshampolu

Hi @sateeshampolu – if you could post some code to reproduce, that would be great, thanks!

mhart avatar Dec 02 '19 13:12 mhart

Hi

I have a simple scenario. `@DynamoDBTable(tableName = "someTable") Class Entity { @DynamoDBVersioned private Long version; @DynamoDBHashKey private String id; private String variableValue; }

in a test if you do Entity e1 = dynamoDbMapper.load(Entity.class, "ID1"); Entity e2 = dynamoDbMapper.load(Entity.class, "ID1"); e1.setVariableValue("value1") e2.setVariableValue("value2") dynamoDbMapper.save(e1); dynamoDbMapper.save(e2);`

when you do this against DynamoDbLocal you get ConditionalCheckFailedException but against Dynalite it just works fine without exception.

sateeshampolu avatar Dec 03 '19 08:12 sateeshampolu

Is there a way you can debug to see what DynamoDB commands that code is issuing to the server?

mhart avatar Dec 03 '19 13:12 mhart