From: Torsten Werner Date: Sat, 22 Jan 2011 12:49:29 +0000 (+0100) Subject: Remove some useless session.flush() calls. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6971bf0918f5e6fb58020950f74bda094a53a77d;p=dak Remove some useless session.flush() calls. We are using sqlalchemy's autoflush mode. Signed-off-by: Torsten Werner --- diff --git a/daklib/dbconn.py b/daklib/dbconn.py index 611b30a0..9c1ed2b3 100755 --- a/daklib/dbconn.py +++ b/daklib/dbconn.py @@ -2266,12 +2266,10 @@ def add_dsc_to_db(u, filename, session=None): source.poolfile_id = entry["files id"] session.add(source) - session.flush() suite_names = u.pkg.changes["distribution"].keys() source.suites = session.query(Suite). \ filter(Suite.suite_name.in_(suite_names)).all() - session.flush() # Add the source files to the DB (files and dsc_files) dscfile = DSCFile() @@ -2321,8 +2319,6 @@ def add_dsc_to_db(u, filename, session=None): df.poolfile_id = files_id session.add(df) - session.flush() - # Add the src_uploaders to the DB uploader_ids = [source.maintainer_id] if u.pkg.dsc.has_key("uploaders"):