Skip to content
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

More documents with "unique" attribute are saved with with same attribute value #137

Open
rdisabato opened this issue Jun 22, 2020 · 1 comment
Assignees

Comments

@rdisabato
Copy link

Hello,

we are using Grails 4.0.2 and Gorm 7.0.3 with Mongo engine set to "codec".

We have an entity with an attribute marked as "unique" in constraints.

If we save more of these entities with the same attribute value by calling an API more times (one write for each API call), and time interval between each call is more than about 400-500 ms, the Gorm engine correctly responds that an entity with the same value already exist.
On the other way, if we make more API calls rapidly, with a time interval of about 50-150 ms, often this results in more entities saved to the db with the same attribute value.

We also reproduce this by invoking the API through asynchronous calls from a javascript for loop at client side in the same network.

I think this is very easy to reproduce, but if you need more informations we are available.

If this results in a real bug and not in an our mistake this could be a very bad problem.

@lucianolap
Copy link

I have the same issue, i'm able to create more users with same username if i call the API many times rapidly. Can anyone tell me how to fix the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants