cassieq icon indicating copy to clipboard operation
cassieq copied to clipboard

Reappearing accounts in addNewKey

Open lucasbru opened this issue 7 years ago • 0 comments

This is related to #128. The function addNewKey

cassieq/core/src/main/java/io/paradoxical/cassieq/admin/resources/api/v1/AccountResource.java

could re-add an account that is concurrently deleted.

SELECT keys FROM account WHERE account = ‘webapp’ 
             DELETE * FROM account WHERE account = 'webapp'
UPDATE account SET keys = {102, 581} WHERE account = ‘webapp’

Effectively, this could create half-empty accounts in the database.

Here, it seems like a lightweight transactions (IF EXISTS) should be used.

lucasbru avatar Oct 24 '17 09:10 lucasbru