From 3f8476212982516411a99b7bf59b262b68b76564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20Domozi?= Date: Mon, 9 Mar 2026 23:08:55 +0100 Subject: [PATCH] Fix Python plugin project reparse Currently, if we try to reparse a Python project, the CodeCompass_parser exits with the following error: "terminate called after throwing an instance of 'odb::object_already_persistent'". As a fix, if the object already exists in the database, we first remove it. --- plugins/python/parser/src/pythonparser.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/python/parser/src/pythonparser.cpp b/plugins/python/parser/src/pythonparser.cpp index f52c8703b..79329b06f 100644 --- a/plugins/python/parser/src/pythonparser.cpp +++ b/plugins/python/parser/src/pythonparser.cpp @@ -88,6 +88,11 @@ void PythonParser::parseProject(const std::string& root_path) { for(const auto& e : map) { + if (_ctx.db->query_one(odb::query::id == e.first)) + { + _ctx.db->erase(e.second); + } + _ctx.db->persist(e.second); } });