{
// Insert changes into database.
DataSource datasource = Application.getDB().getDataSource();
QueryRunner run = new QueryRunner(datasource);
try {
run.update("BEGIN");
for(Entry<String, Change> entry: entries) {
Change change = entry.getValue();
run.update("INSERT INTO changelog (otype, oid, time, status) VALUES (?, ?, ?, ?) ON DUPLICATE KEY UPDATE oid = ?",
change.getOtype(), change.getOid(), change.getTime(), change.getStatus().name(), change.getOid());
}