mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-24 07:44:46 +08:00
Merge pull request #3377 from artoscinote/ma_SCI_5794
Lock repository_row before inserting RepositoryCell [SCI-5794]
This commit is contained in:
commit
d43f7180c1
1 changed files with 4 additions and 1 deletions
|
@ -11,7 +11,10 @@ module ReportActions
|
|||
end
|
||||
|
||||
def save
|
||||
ActiveRecord::Base.transaction do
|
||||
# we lock the row, to prevent two repository cells being created at the same location
|
||||
# as the RepositoryCell validation would pass in both concurrent transactions
|
||||
|
||||
@repository_row.with_lock do
|
||||
asset = create_new_asset
|
||||
delete_old_repository_cell
|
||||
@new_cell_value = create_new_cell_value(asset)
|
||||
|
|
Loading…
Reference in a new issue