*I$Berkeley DB: Db::sync[P

Db::sync





#include <db_cxx.h>

intDb::sync(u_int32_t flags);





Description



;The Db::sync method flushes any cached information to disk.

HIf the database is in memory only, the Db::sync method has no effect andwill always succeed.

EThe flags parameter is currently unused, and must be set to 0.

hSee Db::close for a discussion of Berkeley DB and cached data.

The Db::sync>method either returns errno or throws an exception that:encapsulates an errno on failure, and 0 on success.



Errors

OIf a fatal error occurs in Berkeley DB, the Db::sync method may fail and eitherIreturn DB_RUNRECOVERY or throw an exception encapsulating DB_RUNRECOVERY,Gat which point all subsequent database calls will also fail in the sameFway. Methods marked as returning errno will, by default, throwHan exception that encapsulates the error information. The default error\behavior can be changed, see DbException.

The Db::sync&method may fail and throw an exceptionKfor any of the errors specified for the following Berkeley DB and C library functions:6Db::cursor,0Db::get, Db::sync,DBcursor->c_close(3),__account_page(3), close(3),dbenv->db_paniccall(3), fcntl(3), fflush(3), fprintf(3),free(3),func(3),>DbLockTab::get,8DbLock::put,>DbLockTab::vec,6DbLog::put, malloc(3), memcpy(3), memmove(3),BDbMpoolFile::get,BDbMpoolFile::put,BDbMpoolFile::set,DDbMpoolFile::sync, memset(3), munmap(3),open(3), realloc(3),sigfillset(3),sigprocmask(3), strerror(3), unlink(3), vfprintf(3), vsnprintf(3),and write(3).

In addition, the Db::sync&method may fail and throw an exceptionor return errnofor the following conditions:

B

EINVAL
An invalid flag value or parameter was specified.







Class

,Db



See Also

4Db::close,6Db::cursor,0Db::del,.Db::fd,0Db::get,HDb::get_byteswapped,:Db::get_type,2Db::join,2Db::open,0Db::put,1Db::statand Db::sync.
ÿÿ