1999-02-06 00:23:03 +08:00
|
|
|
/* txn.h - Header for TP support functions of the bdb2 backend */
|
1999-09-09 03:06:24 +08:00
|
|
|
/* $OpenLDAP$ */
|
1999-02-06 00:23:03 +08:00
|
|
|
|
|
|
|
#ifndef _BDB2_TXN_H_
|
|
|
|
#define _BDB2_TXN_H_
|
|
|
|
|
|
|
|
#include "portable.h"
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
|
1999-06-03 08:37:44 +08:00
|
|
|
#include <ac/dirent.h>
|
1999-02-17 02:07:19 +08:00
|
|
|
#include <ac/errno.h>
|
1999-02-06 00:23:03 +08:00
|
|
|
#include <ac/signal.h>
|
1999-02-17 02:07:19 +08:00
|
|
|
#include <ac/socket.h>
|
|
|
|
#include <ac/string.h>
|
|
|
|
#include <ac/time.h>
|
|
|
|
#include <ac/unistd.h>
|
1999-02-06 00:23:03 +08:00
|
|
|
|
|
|
|
#include "slap.h"
|
|
|
|
#include "back-bdb2.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
1999-03-05 18:25:55 +08:00
|
|
|
/* the DB environment for the backend */
|
|
|
|
DB_ENV bdb2i_dbEnv;
|
|
|
|
|
|
|
|
|
1999-03-01 19:30:18 +08:00
|
|
|
/* variables for transaction support */
|
|
|
|
DB_TXN *txnid = NULL;
|
|
|
|
int txn_do_abort = 0;
|
1999-02-06 00:23:03 +08:00
|
|
|
|
1999-03-01 19:30:18 +08:00
|
|
|
u_int32_t txn_max_pending_log;
|
|
|
|
u_int32_t txn_max_pending_time;
|
|
|
|
int txn_dirty = 0;
|
|
|
|
ldap_pvt_thread_mutex_t txn_dirty_mutex;
|
1999-02-06 00:23:03 +08:00
|
|
|
|
1999-03-01 19:30:18 +08:00
|
|
|
/* defaults for checkpointing */
|
|
|
|
#define BDB2_TXN_CHKP_MAX_LOG 2000 /* checkpoint every 2MB lock file
|
|
|
|
(approx. 20 ADD TXNs) */
|
|
|
|
#define BDB2_TXN_CHKP_MAX_TIME 5 /* checkpoint after 5 minutes */
|
|
|
|
|
|
|
|
|
|
|
|
/* the name of the file and the record number of the NEXTID datum */
|
|
|
|
#define NEXTID_NAME "NEXTID"
|
|
|
|
#define NEXTID_RECNO (db_recno_t) 1
|
|
|
|
|
|
|
|
|
1999-02-06 00:23:03 +08:00
|
|
|
|
|
|
|
#endif /* _BDB2_TXN_H_ */
|
|
|
|
|