/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 2000-2009 The OpenLDAP Foundation.
+ * Copyright 2000-2011 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
size_t textlen = sizeof textbuf;
AttributeDescription *children = slap_schema.si_ad_children;
AttributeDescription *entry = slap_schema.si_ad_entry;
- DB_TXN *ltid = NULL, *lt2, *rtxn;
+ DB_TXN *ltid = NULL, *lt2;
ID eid = NOID;
struct bdb_op_info opinfo = {{{ 0 }}};
int subentry;
subentry = is_entry_subentry( op->ora_e );
- /* Get our reader TXN */
- rs->sr_err = bdb_reader_get( op, bdb->bi_dbenv, &rtxn );
-
if( 0 ) {
retry: /* transaction retry */
if( p ) {
nrdn = op->ora_e->e_nname;
}
- /* Use the reader txn here, outside the add txn */
- bdb_cache_add( bdb, ei, op->ora_e, &nrdn, rtxn, &lock );
+ bdb_cache_add( bdb, ei, op->ora_e, &nrdn, ltid, &lock );
if(( rs->sr_err=TXN_COMMIT( ltid, 0 )) != 0 ) {
rs->sr_text = "txn_commit failed";
return_results:
success = rs->sr_err;
send_ldap_result( op, rs );
- slap_graduate_commit_csn( op );
if( ltid != NULL ) {
TXN_ABORT( ltid );
* Possibly a callback may have mucked with it, although
* in general callbacks should treat the entry as read-only.
*/
- bdb_cache_return_entry_r( bdb, oe, &lock );
+ bdb_cache_deref( oe->e_private );
if ( op->ora_e == oe )
op->ora_e = NULL;
}
}
+ slap_graduate_commit_csn( op );
+
if( postread_ctrl != NULL && (*postread_ctrl) != NULL ) {
slap_sl_free( (*postread_ctrl)->ldctl_value.bv_val, op->o_tmpmemctx );
slap_sl_free( *postread_ctrl, op->o_tmpmemctx );
}
-
return rs->sr_err;
}