-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle RecordNotUnique error correctly (#1081)
In the find_or_create_all_with_like_by_name method, instead of issuing a ROLLBACK statement, we wrap the tag creation in a transaction instead. Issuing a ROLLBACK will break nested transactions, and also does not respect multiple databases (available since Rails 6). Adds a spec which attempts to simulate concurrent tag creation. Adds spec option to use truncation database strategy so the spec can see committed records from another thread Co-authored-by: Thong Kuah <tkuah@gitlab.com>
- Loading branch information
Showing
4 changed files
with
48 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters