Forum OpenACS Q&A: Response to Possible deadlock in transaction

Collapse
Posted by Don Baccus on
It looks like a lock's been taken (not explicitly, though, not by cal_insert_recurrences) but why not rewrite the insert loop as:
foreach club $club_ids {
    db_dml cal_club_map_inserts "
        insert into cal_item_club_map (item_id, club_id)
        select item_id, :club
        from cal_items
        where parent_id = :parent_id
          and item_id <> :item_id"
}