public static boolean saveWaypoints(final Geocache cache) {
        return withAccessLock(() -> {

            init();
            database.beginTransaction();
            try {
                saveFinalDefinedStatusWithoutTransaction(cache);
                saveWaypointsWithoutTransaction(cache);
                database.setTransactionSuccessful();
                return true;
            } catch (final Exception e) {
                Log.e("saveWaypoints", e);
            } finally {
                database.endTransaction();
            }
            return false;
        });
    }
Persists the given {@code location} into the database.

@param location a location to save
main/src/main/java/cgeo/geocaching/storage/DataStore.java