store --force does not work
[INFO 2018-11-06 10:00] - Storing analysis results for run 'TinyXML'
[INFO 2018-11-06 10:00] - argument --force was specified: the run with name 'TinyXML' will be deleted.
[ERROR 2018-11-06 10:00] - API call error: massStoreRun
[ERROR 2018-11-06 10:00] - RequestFailed(errorCode=2, extraInfo=None, _message='(psycopg2.IntegrityError) duplicate key value violates unique constraint "uq_runs_name"\\nDETAIL:  Key (name)=(TinyXML) already exists.\\n [SQL: \\'INSERT INTO runs (date, duration, name, version, command, can_delete) VALUES (%(date)s, %(duration)s, %(name)s, %(version)s, %(command)s, %(can_delete)s) RETURNING runs.id\\'] [parameters: {\\'name\\': \\'TinyXML\\', \\'duration\\': -1, \\'version\\': \\'6.8.1\\', \\'command\\': u\\'/home/compass/srv/CodeCheckerv6/workspace/install/CodeChecker/cc_bin/CodeChecker.py analyze -e sensitive /home/compass/srv/CodeCheckerv6/source/tinyxml2-6.2.0/build/compile_commands.json -j24 -o /home/compass/srv/CodeCheckerv6/workspace/reports\\', \\'can_delete\\': True, \\'date\\': datetime.datetime(2018, 11, 6, 10, 0, 3, 873541)}]')

diff --git a/libcodechecker/server/api/store_handler.py b/libcodechecker/server/api/store_handler.py
index c8405d4c..08ebc9fd 100644
--- a/libcodechecker/server/api/store_handler.py
+++ b/libcodechecker/server/api/store_handler.py
@@ -229,6 +229,9 @@ def addCheckerRun(session, command, name, tag, username,
 
             LOG.info('Removing previous analysis results ...')
             session.delete(run)
+            # Not flushing after delete leads to a constraint violation error
+            # later, when adding run entity with the same name as the old one.
+            session.flush()
 
             checker_run = Run(name, version, command)
             session.add(checker_run)
['libcodechecker/server/api/store_handler.py']