Fix dbapi reindex_reference_maps tool to properly close transaction (#847)

Fixes #11195
This commit is contained in:
Paul Culley 2019-07-31 16:35:05 -05:00 committed by GitHub
parent 80749afd09
commit 15e033c02c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -787,6 +787,7 @@ class DBAPI(DbGeneric):
Reindex all primary records in the database. Reindex all primary records in the database.
""" """
callback(4) callback(4)
self._txn_begin()
self.dbapi.execute("DELETE FROM reference") self.dbapi.execute("DELETE FROM reference")
primary_table = ( primary_table = (
(self.get_person_cursor, Person), (self.get_person_cursor, Person),
@ -818,6 +819,7 @@ class DBAPI(DbGeneric):
obj.__class__.__name__, obj.__class__.__name__,
ref_handle, ref_handle,
ref_class_name]) ref_class_name])
self._txn_commit()
callback(5) callback(5)
def rebuild_secondary(self, callback=None): def rebuild_secondary(self, callback=None):