public void synchronize() throws VictimsException {
        Throwable throwable = null;
        try {
            Connection connection = getConnection();
            connection.setAutoCommit(false);
            Savepoint savepoint = connection.setSavepoint();

            try {
                VictimsService service = new VictimsService();
                Date since = lastUpdated();

                int removed = remove(connection, service.removed(since));
                int updated = update(connection, service.updates(since));

                if (removed > 0 || updated > 0) {
                    cache.purge();
                }

                setLastUpdate(new Date());
            } catch (IOException e) {
                throwable = e;
            } catch (SQLException e) {
                throwable = e;
            } finally {
                if (throwable != null) {
                    connection.rollback(savepoint);
                }
                connection.releaseSavepoint(savepoint);
                connection.commit();
                connection.close();
            }
        } catch (SQLException e) {
            throwable = e;
        }

        if (throwable != null) {
            throw new VictimsException("Failed to sync database", throwable);
        }
    }