@Override
        public void run() {

            Database db = new Database();

            while (running || parent.getQueueCount() > 0) {
                LocationHistory history = parent.getNextHistory();
                if (history == null) {
                    LockSupport.park();
                } else {
                    db.insertHistory(history);
                }
            }
        }