|
> Well I guess you might need some kind of tx or compare and swap operation though. We are already doing this, the value of the sequene is incremented while acquiring a lock on the node.
Since Neo4j does not have a native way of mapping sequences, the TABLE and SEQUENCE strategies are almost the same, the only difference is that in the first case the node is labeled with the generator key and in the second case is labeled with a default value. I still need a label to create a unique constraint and avoid having two nodes with the same "sequence_name".
As far as I understand, the purpose of the TABLE strategy is to simulate sequences on db that don't have them, like in this case. So, It feels weird to me to throw an exception. I agree that the name is misleading since Neo4j does not have tables. It also does not have sequences, though.
What about the use case where a user wants to try OGM with an existing model: should he has to replace the generation strategies, if the datastore does not support them, or should OGM use the available strategies to simulate the required behaviour (as best as it is can)?
|