cassieq
cassieq copied to clipboard
Reappearing accounts in addNewKey
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.