Berkeley DB: DbMpoolFile::sync
Description: Berkeley DB: An embedded database programmatic toolkit.
Keywords: embedded,database,programmatic,toolkit,b+tree,btr ee,hash,hashing,transaction,transactions,locking,logging,access method,access me thods,java,C,C++

# DbMpoolFile::sync

`

###

    #include <db_cxx.h>

    int
    DbMpoolFile::sync();

# Description

The DbMpoolFile::sync method writes all pages associated with the DbMpoolFile object, that were marked as modified using DbMpoolFile::put or DbMpoolFile::set, back to the source file. If any of the modified pages are also pinned (i.e., currently referenced by this or another process) DbMpoolFile::sync will ignore them.

The DbMpoolFile::sync method either returns errno or throws an exception that encapsulates an errno on failure, and 0 on success, and DB_INCOMPLETE if there were pages which were modified but which DbMpoolFile::sync was unable to write.

# Errors

If a fatal error occurs in Berkeley DB, the DbMpoolFile::sync method may fail and either return DB_RUNRECOVERY or throw an exception encapsulating DB_RUNRECOVERY, at which point all subsequent database calls will also fail in the same way. Methods marked as returning errno will, by default, throw an exception that encapsulates the error information. The default error behavior can be changed, see DbException.

The DbMpoolFile::sync method may fail and throw an exception for any of the errors specified for the following Berkeley DB and C library functions: DBmemp->pgin(3), DBmemp->pgout(3), abort(3), close(3), dbenv->db_paniccall(3), fcntl(3), fflush(3), fprintf(3), free(3), fsync(3), getenv(3), getpid(3), getuid(3), isdigit(3), DbLog::compare, DbLog::flush, lseek(3), malloc(3), memcpy(3), memset(3), open(3), pread(3), pwrite(3), qsort(3), read(3), realloc(3), sigfillset(3), sigprocmask(3), stat(3), strerror(3), strlen(3), unlink(3), vfprintf(3), vsnprintf(3), and write(3).

# Class

DbMpoolFile

# See Also

DbMpoolFile::close, DbMpoolFile::get, DbMpoolFile::open, DbMpoolFile::put, DbMpoolFile::set and DbMpoolFile::sync.`