closure_tree을 사용하여 계층 구조에서 공통 속성을 가진 모델 세트를 동시에 조작 할 때 데이터베이스 교착 상태를 피하는 방법은 무엇입니까?클로저 트리 계층을 동시에 편집 할 때 교착 상태
그들은 다음과 같은 맛을 제공 :
Mysql2::Error: Deadlock found when trying to get lock; try restarting transaction:
DELETE FROM `element_hierarchies`
WHERE descendant_id IN (
SELECT DISTINCT descendant_id
FROM (SELECT descendant_id
FROM `element_hierarchies`
WHERE ancestor_id = 16332
) AS x)
OR descendant_id = 16332
Mysql2::Error: Deadlock found when trying to get lock; try restarting transaction:
INSERT INTO `element_hierarchies` (`ancestor_id`, `descendant_id`, `generations`) VALUES (30910, 30910, 0)
with_advisory_lock 유망 보이는 폐쇄 테이블을 다시 작성하는 경우
것은 #append/prepend_sibling
Mysql2::Error: Deadlock found when trying to get lock; try restarting transaction:
UPDATE `elements` SET `sort_order` = `sort_order` + 1 WHERE (`parent_id` = 28035 AND `sort_order` >= 1)
Mysql2::Error: Deadlock found when trying to get lock; try restarting transaction:
UPDATE `elements` SET `sort_order` = `sort_order` - 1 WHERE (`parent_id` = 21168 AND `sort_order` <= -1)
을 발행합니다. 이견있는 사람?
이 문제는 해결되었습니다. v3.7.3으로 업그레이드하십시오. – mrm
http://stackoverflow.com/questions/41388300/use-ruby-closure-tree-gem-without-rails에서 내 질문을 살펴볼 수 있습니까? – peter