architect / dynalite

An implementation of Amazon's DynamoDB built on LevelDB
Apache License 2.0
1.04k stars 107 forks source link

Optimistic locking not supported by Dynalite #119

Open sateeshampolu opened 4 years ago

sateeshampolu commented 4 years ago

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.

mhart commented 4 years ago

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

sateeshampolu commented 4 years ago

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.

mhart commented 4 years ago

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