1 /* operational.c - bdb backend operational attributes function */
3 * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
11 #include <ac/string.h>
12 #include <ac/socket.h>
16 #include "proto-bdb.h"
19 * sets the supported operational attributes (if required)
32 struct bdb_info *bdb = (struct bdb_info *) be->be_private;
36 struct bdb_op_info opinfo;
40 if ( !opattrs && !ad_inlist( slap_schema.si_ad_hasSubordinates, attrs ) ) {
46 retry: /* transaction retry */
48 bdb_cache_return_entry_w(&bdb->bi_cache, e);
50 Debug( LDAP_DEBUG_TRACE, "==> bdb_delete: retrying...\n",
52 rc = TXN_ABORT( ltid );
59 ldap_pvt_thread_yield();
62 /* begin transaction */
63 rc = TXN_BEGIN( bdb->bi_dbenv, NULL, <id, bdb->bi_db_opflags );
65 Debug( LDAP_DEBUG_TRACE,
66 "bdb_operational: txn_begin failed: %s (%d)\n",
67 db_strerror( rc ), rc, 0 );
73 opinfo.boi_txn = ltid;
75 op->o_private = &opinfo;
77 rc = bdb_dn2id_children( be, ltid, &e->e_nname );
80 case DB_LOCK_DEADLOCK:
81 case DB_LOCK_NOTGRANTED:
86 *aa = slap_operational_hasSubordinate( rc == 0 );
93 Debug(LDAP_DEBUG_ARGS,
94 "<=- bdb_operational: has_children failed: %s (%d)\n",
95 db_strerror(rc), rc, 0 );
100 if ( rc == LDAP_SUCCESS && bdb->bi_txn_cp ) {
101 ldap_pvt_thread_yield();
102 TXN_CHECKPOINT( bdb->bi_dbenv,
103 bdb->bi_txn_cp_kbyte, bdb->bi_txn_cp_min, 0 );
106 if ( ltid != NULL ) {
108 op->o_private = NULL;