on = (slap_overinst *)p->ce_bi;
cm = on->on_bi.bi_private;
ca->be = &cm->db;
- ca->cleanup = pc_ldadd_cleanup;
+ /* Defer open if this is an LDAPadd */
+ if ( CONFIG_ONLINE_ADD( ca ))
+ ca->cleanup = pc_ldadd_cleanup;
+ else
+ cm->defer_db_open = 0;
ca->private = on;
return LDAP_SUCCESS;
}
ov = on->on_bi.bi_private;
ca->be = &ov->db;
ca->private = on;
- ca->cleanup = translucent_ldadd_cleanup;
+ if ( CONFIG_ONLINE_ADD( ca ))
+ ca->cleanup = translucent_ldadd_cleanup;
+ else
+ ov->defer_db_open = 0;
+
return LDAP_SUCCESS;
}