hdb_cache_find_parent(
        Operation *op,
        DB_TXN *txn,
+       u_int32_t       locker,
        ID id,
        EntryInfo **res )
 {
        ei.bei_ckids = 0;
 
        for (;;) {
-               rc = hdb_dn2id_parent( op, txn, &ei, &eip.bei_id );
+               rc = hdb_dn2id_parent( op, txn, locker, &ei, &eip.bei_id );
                if ( rc ) break;
 
                /* Save the previous node, if any */
                        }
                }
 #else
-               rc = hdb_cache_find_parent(op, tid, id, eip );
+               rc = hdb_cache_find_parent(op, tid, locker, id, eip );
                if ( rc == 0 && *eip ) islocked = 1;
 #endif
        }
 
 hdb_dn2id_parent(
        Operation *op,
        DB_TXN *txn,
+       u_int32_t       locker,
        EntryInfo *ei,
        ID *idp )
 {
 
        rc = db->cursor( db, txn, &cursor, bdb->bi_db_opflags );
        if ( rc ) return rc;
+       if ( !txn && locker ) {
+               cursor->locker = locker;
+       }
 
        data.ulen = sizeof(diskNode) + (SLAP_LDAPDN_MAXLEN * 2);
        d = op->o_tmpalloc( data.ulen, op->o_tmpmemctx );
 
 int bdb_dn2id_parent(
        Operation *op,
        DB_TXN *txn,
+       u_int32_t locker,
        EntryInfo *ei,
        ID *idp );
 
 bdb_cache_find_parent(
        Operation *op,
        DB_TXN *txn,
+       u_int32_t       locker,
        ID id,
        EntryInfo **res
 );
 
                op.o_tmpmemctx = NULL;
                op.o_tmpmfuncs = &ch_mfuncs;
 
-               rc = bdb_cache_find_parent( &op, NULL, id, &ei );
+               rc = bdb_cache_find_parent( &op, NULL, cursor->locker, id, &ei );
                if ( rc == LDAP_SUCCESS ) {
                        bdb_cache_entryinfo_unlock( ei );
                        e->e_private = ei;