mme_sync_db_check()

Check and repair a folder with inconsistencies

Synopsis:

#include <mme/mme.h>

int mme_sync_db_check( mme_hdl_t *hdl,
                       uint64_t folderid,
                       uint32_t flags );

Arguments:

hdl
An MME connection handle.
folderid
The ID of the folder to verify and repair.
flags
Flags controlling the verification and repair. See Flags below.

Library:

mme

Description:

The function mme_sync_db_check() checks the specified folder for consistency and, optionally, attempts to repair any errors it encounters. It:

The function mme_sync_db_check():


Caution: If mme_sync_db_check() finds and is unable to repair inconsistencies between the MME database and a folder, there is probably a problem with the database that requires immediate attention.

When and how to use mme_sync_db_check()

You should use mme_sync_db_check() if you suspect a problem with the MME database, and proceed as follows:

  1. Call mme_sync_db_check() to verify the folder that may be the source of the problem (do not set flags to MME_SYNC_OPTION_REPAIR). If the function reports zero inconsistencies, the database does not require repair.
  2. If mme_sync_db_check() reports and logs inconsistencies, call the function again with the flags option set to MME_SYNC_OPTION_REPAIR.
  3. After mme_sync_db_check() finishes repairing the database, run this function again, with the flags option not set to MME_SYNC_OPTION_REPAIR — you need to verify that the repair was completely successful.
  4. If mme_sync_db_check() still reports inconsistencies:
    1. Contact QNX and forward, if possible:
      • all logs
      • the database with the inconsistencies
      • a copy of the mediastore associated with the inconsistencies; this copy must keep all file modification times from the original
    2. Restart and resynchronize the mediastore with the inconsistencies by calling mme_ms_restart() to delete all database contents associated with this mediastore.
    3. If resynchronization of an newly active mediastore is not automatic on your system, call mme_resync_mediastore() to synchronize the mediastore.
  5. If mme_sync_db_check() no longer reports inconsistencies, resynchronize the mediastore by calling mme_resync_mediastore().

Flags

The behavior of mme_sync_db_check() is determined by the values of the flags argument:

Events

None delivered.

Blocking and validation

This function checks that:

This function runs synchronously, and therefore blocks.

Returns:

0
Success: the verification or repair operation has started.
-1
An error occurred (errno is set).

Classification:

QNX Neutrino

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

MME_SYNC_OPTION_*