diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index 28b6bdc9..c7e00190 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -1110,6 +1110,7 @@ class Database: """(Re-)creates the tables of the current DB""" self.drop_tables() + self.resetPlayerIDs() self.create_tables() self.createAllIndexes() self.commit() @@ -1838,6 +1839,9 @@ class Database: #FIXME: recognise currency return tmp[0] + def resetPlayerIDs(self): + self.pcache = None + def getSqlPlayerIDs(self, pnames, siteid): result = {} if(self.pcache == None): diff --git a/pyfpdb/fpdb.pyw b/pyfpdb/fpdb.pyw index 295ed7d3..8cd8b129 100755 --- a/pyfpdb/fpdb.pyw +++ b/pyfpdb/fpdb.pyw @@ -547,6 +547,10 @@ class fpdb: # self.release_global_lock() # lock_released = True self.db.recreate_tables() + # find any guibulkimport windows and clear player cache: + for t in self.threads: + if isinstance(t, GuiBulkImport.GuiBulkImport): + t.importer.database.resetPlayerIDs() self.release_global_lock() #else: # for other dbs use same connection as holds global lock