Library Version 12.1.6.0

DbEnv::memp_sync()
Prev | Chapter 9. The DbMpoolFile Handle | Next

## DbEnv::memp_sync()

    #include <db_cxx.h>

    int
    DbEnv::memp_sync(DbLsn *lsn);

The `DbEnv::memp_sync()` method flushes modified pages in the cache to their backing files.

Pages in the cache that cannot be immediately written back to disk (for example, pages that are currently in use by another thread of control) are waited for and written to disk as soon as it is possible to do so.

The `DbEnv::memp_sync()` method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success.

### Parameters

#### lsn

The purpose of the lsn parameter is to enable a transaction manager to ensure, as part of a checkpoint, that all pages modified by a certain time have been written to disk.

All modified pages with a a log sequence number (DbLsn) less than the lsn parameter are written to disk. If lsn is NULL, all modified pages in the cache are written to disk.

### Class

DbEnv, DbMpoolFile

### See Also

Memory Pools and Related Methods

Prev | Up | Next
DbEnv::memp_stat_print() | Home | DbEnv::memp_trickle()