New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possibility to disable or clear SequenceAllocation in PolyJDBC #532
Labels
Comments
Ok, now the problem description is clear. |
Sure, I can create the corresponding PRs. |
Ok, so now we have the new feature in polyjdbc. Feel free to create corresponding PR to javers |
mdii
added a commit
to mdii/javers
that referenced
this issue
Apr 24, 2017
mdii
added a commit
to mdii/javers
that referenced
this issue
Apr 25, 2017
mdii
added a commit
to mdii/javers
that referenced
this issue
Apr 25, 2017
bartoszwalacik
added a commit
that referenced
this issue
May 6, 2017
…ation-cache #532 possibility to clear SequenceAllocation cache
released in 3.1.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I encountered again the issue I reported in #506.
We are using Javers with Spring boot and H2 as the test database. Before each test we truncate all the tables and reset the sequences. We don't reinitialize the Spring context before each test because it is quite time consuming. Therefore, we need to reset any state/cache before each test, including the sequecne cache in SequenceAllocation.
Basically, if we don't clear the sequence cache, the following situation might happen (assuming 50 as the size of the sequence batch):
Before test A: spring context is initialized.
Before test A: all tables are truncated and all sequences are reset
In test A: sequence numbers 1 to 50 are cached and JaVers uses sequence 1 to 30.
Before test B: all tables are truncated and all sequences are reset
In test B: sequence numbers 31 to 50 are still in the cache. JaVers uses these values and ask the DB for the next batch of sequence numbers, which are again 1 to 50. JaVers uses these values but when it want to store a row in the DB with sequence number 31, an exception occurs since a row with this primary key already exists.
The text was updated successfully, but these errors were encountered: