Some problems with persistent structures
Hello
I've found some problems with persistent structures:
1. PersistentMap.remove(key) doesn't work when invoked after PersistentMap.put(key,value) in the same transaction. It's because PersistentMap.remove() doesn't remove entry from newAndUpdatedEntries (which is added to storage during commit).
2. The same with PersistentMap.clear()
3. PersistentMap.size() always returns map's size before transaction
4. PersistentVector.get() may ignore elements that were in vector before transaction
5. PersistentVector.slice() ignore elements added in current transaction
6. PersistentVector.update() ignores transaction and commits changes immediately!!!!
7. There are no removal methods in PersistentVector
What do you think about these issues? Some of them are certainly easy to fix.
I've found some problems with persistent structures:
1. PersistentMap.remove(key) doesn't work when invoked after PersistentMap.put(key,value) in the same transaction. It's because PersistentMap.remove() doesn't remove entry from newAndUpdatedEntries (which is added to storage during commit).
2. The same with PersistentMap.clear()
3. PersistentMap.size() always returns map's size before transaction
4. PersistentVector.get() may ignore elements that were in vector before transaction
5. PersistentVector.slice() ignore elements added in current transaction
6. PersistentVector.update() ignores transaction and commits changes immediately!!!!
7. There are no removal methods in PersistentVector
What do you think about these issues? Some of them are certainly easy to fix.
Leave a comment