int dbPersonId = Integer.parseInt(Sql.getLastInsertId(conn));
PersonIdentifierList.update(conn, dbPersonId, p.getPersonIdentifierList(), null);
FingerprintList.update(conn, dbPersonId, p.getFingerprintList(), null);
VisitList.update(conn, Sql.REGULAR_VISIT_TYPE_ID, dbPersonId, p.getLastRegularVisit());
VisitList.update(conn, Sql.ONE_OFF_VISIT_TYPE_ID, dbPersonId, p.getLastOneOffVisit());
PersonMatch newPer = new PersonMatch(p.clone()); // Clone to protect from unit test modifications.
newPer.setDbPersonId(dbPersonId);
this.add(newPer);
SearchHistory.update(req, null, null); // Update search history showing that no candidate was selected.
}
Sql.commit(conn);