public static void saveTrailpoint(final Location location) {
        withAccessLock(() -> {

            init();

            database.beginTransaction();
            try {
                final SQLiteStatement insertTrailpoint = PreparedStatement.INSERT_TRAILPOINT.getStatement();
                insertTrailpoint.bindDouble(1, location.getLatitude());
                insertTrailpoint.bindDouble(2, location.getLongitude());
                insertTrailpoint.bindDouble(3, GeoHeightUtils.getAltitude(location));
                insertTrailpoint.bindLong(4, System.currentTimeMillis());
                insertTrailpoint.executeInsert();
                database.setTransactionSuccessful();
            } catch (final Exception e) {
                Log.e("Updating trailHistory db failed", e);
            } finally {
                database.endTransaction();
            }
        });
    }
Persists the given {@code location} into the database.

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