As this method is doing things with the database, you need to add the @forcedbthread decorator to be sure we're on the database thread.