From fce0df37f8c31e3ee57d34e1284eae7c17e3e935 Mon Sep 17 00:00:00 2001
From: Marko Mecina <marko.mecina@univie.ac.at>
Date: Mon, 31 May 2021 09:53:14 +0200
Subject: [PATCH] start new transaction before querying codeblocks DB

---
 Tst/codeblockreusefeature/codeblockreuse.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Tst/codeblockreusefeature/codeblockreuse.py b/Tst/codeblockreusefeature/codeblockreuse.py
index c585798..3f81839 100755
--- a/Tst/codeblockreusefeature/codeblockreuse.py
+++ b/Tst/codeblockreusefeature/codeblockreuse.py
@@ -769,8 +769,9 @@ class CBRSearch(Gtk.Box):
         Loads the data from the database. The filter properties are used to build the SQL query.
         """
         self.logger.debug('Loading data from the database')
+        self.session.commit()  # this updates the session instantiated in the class init
         if self.filter_searchstring != '':
-            self.data = db_interaction.query_using_textsearch(session=self.session, expressions=searchstring)
+            self.data = db_interaction.query_using_textsearch(session=self.session, expressions=self.filter_searchstring)
         else:
             self.data = db_interaction.query_get_all_entries(self.session)
         self.load_data_into_liststore(self.data)
-- 
GitLab