-
Bug
-
Resolution: Unresolved
-
Medium
-
None
-
5.2.0
-
5
-
Severity 3 - Minor
-
1
-
Issue Summary
Simultaneous requests to add the same merge check can lead to duplicate data in the database
Steps to Reproduce
- Two simultaneous requests to enable a merge check on a repository or a project can, under certain circumstances, lead to duplicate data being inserted to the database for the merge check
Expected Results
- Uniqueness should be enforced such that it is not possible to insert the exact same merge check more than once
Actual Results
- Under certain circumstances duplicate data can be inserted to the database for the exact same merge check for a particular project or repository.
- When this happens if the user tries to access pull request settings for the repository they will get an error message "A database has occurred" and the application logs show an exception along the following lines:
Caused by: org.hibernate.NonUniqueResultException: query did not return a unique result: 2 at org.hibernate.query.internal.AbstractProducedQuery.uniqueElement(AbstractProducedQuery.java:1601) at org.hibernate.query.internal.AbstractProducedQuery.uniqueResult(AbstractProducedQuery.java:1571) at org.hibernate.query.criteria.internal.compile.CriteriaQueryTypeQueryAdapter.uniqueResult(CriteriaQueryTypeQueryAdapter.java:81) at com.atlassian.stash.internal.repository.HibernateRepositoryHookDao.findByKey(HibernateRepositoryHookDao.java:72) at com.atlassian.stash.internal.hook.repository.DefaultRepositoryHookService.getEffectiveRepositoryHook(DefaultRepositoryHookService.java:593) at com.atlassian.stash.internal.hook.repository.DefaultRepositoryHookService.getByKey(DefaultRepositoryHookService.java:268) ... 49 common frames omitted
Workaround
Currently there is no known workaround for this behavior. A workaround will be added here when available
- mentioned in
-
Page Loading...