#
# Hints can also be found in the OpenLDAP Software FAQ
# <http://www.openldap.org/faq/index.cgi?file=2>
+# in particular:
+# <http://www.openldap.org/faq/index.cgi?file=1075>
# one 0.25 GB cache
set_cachesize 0 268435456 1
op->o_bd = frontendDB;
rc = frontendDB->be_add( op, rs );
+
+#ifdef LDAP_X_TXN
+ if ( rc == LDAP_X_TXN_SPECIFY_OKAY ) {
+ /* skip cleanup */
+ return rc;
+ } else
+#endif
if ( rc == 0 ) {
if ( op->ora_e != NULL && op->o_private != NULL ) {
BackendDB *bd = op->o_bd;
if ( op->o_bd->be_add ) {
/* do the update here */
int repl_user = be_isupdate( op );
- if ( !SLAP_SINGLE_SHADOW(op->o_bd) || repl_user )
- {
+ if ( !SLAP_SINGLE_SHADOW(op->o_bd) || repl_user ) {
int update = !BER_BVISEMPTY( &op->o_bd->be_update_ndn );
slap_callback cb = { NULL, slap_replog_cb, NULL, NULL };
/* insert operation into transaction */
rs->sr_text = "transaction specified";
- rs->sr_err = LDAP_SUCCESS;
+ rs->sr_err = LDAP_X_TXN_SPECIFY_OKAY;
txnReturn:
/* release connection lock */
/* insert operation into transaction */
rs->sr_text = "transaction specified";
- rs->sr_err = LDAP_SUCCESS;
+ rs->sr_err = LDAP_X_TXN_SPECIFY_OKAY;
txnReturn:
/* release connection lock */
/* insert operation into transaction */
rs->sr_text = "transaction specified";
- rs->sr_err = LDAP_SUCCESS;
+ rs->sr_err = LDAP_X_TXN_SPECIFY_OKAY;
txnReturn:
/* release connection lock */
/* insert operation into transaction */
rs->sr_text = "transaction specified";
- rs->sr_err = LDAP_SUCCESS;
+ rs->sr_err = LDAP_X_TXN_SPECIFY_OKAY;
txnReturn:
/* release connection lock */
goto operations_error;
}
+#ifdef LDAP_X_TXN
+ if (( conn->c_txn == CONN_TXN_SPECIFY ) && (
+ ( tag == LDAP_REQ_ADD ) ||
+ ( tag == LDAP_REQ_DELETE ) ||
+ ( tag == LDAP_REQ_MODIFY ) ||
+ ( tag == LDAP_REQ_MODRDN )))
+ {
+ /* Disable SLAB allocator for all update operations
+ issued inside of a transaction */
+ op->o_tmpmemctx = NULL;
+ op->o_tmpmfuncs = &ch_mfuncs;
+ } else
+#endif
+ {
/* We can use Thread-Local storage for most mallocs. We can
* also use TL for ber parsing, but not on Add or Modify.
*/
*/
ber_set_option( op->o_ber, LBER_OPT_BER_MEMCTX, &memctx );
}
+ }
switch ( tag ) {
case LDAP_REQ_BIND:
op->o_bd = frontendDB;
rs->sr_err = frontendDB->be_delete( op, rs );
+#ifdef LDAP_X_TXN
+ if( rs->sr_err == LDAP_X_TXN_SPECIFY_OKAY ) {
+ /* skip cleanup */
+ return rs->sr_err;
+ }
+#endif
+
cleanup:;
op->o_tmpfree( op->o_req_dn.bv_val, op->o_tmpmemctx );
op->o_tmpfree( op->o_req_ndn.bv_val, op->o_tmpmemctx );
if ( op->o_bd->be_delete ) {
/* do the update here */
int repl_user = be_isupdate( op );
- if ( !SLAP_SINGLE_SHADOW(op->o_bd) || repl_user )
- {
+ if ( !SLAP_SINGLE_SHADOW(op->o_bd) || repl_user ) {
struct berval org_req_dn = BER_BVNULL;
struct berval org_req_ndn = BER_BVNULL;
struct berval org_dn = BER_BVNULL;
op->o_bd = op_be;
- if ( !op->o_bd->be_update_ndn.bv_len || !repl_user )
- {
+ if ( !op->o_bd->be_update_ndn.bv_len || !repl_user ) {
cb.sc_next = op->o_callback;
op->o_callback = &cb;
}
op->o_bd = frontendDB;
rs->sr_err = frontendDB->be_modify( op, rs );
+#ifdef LDAP_X_TXN
+ if( rs->sr_err == LDAP_X_TXN_SPECIFY_OKAY ) {
+ /* skip cleanup */
+ return rs->sr_err;
+ }
+#endif
+
cleanup:
op->o_tmpfree( op->o_req_dn.bv_val, op->o_tmpmemctx );
op->o_tmpfree( op->o_req_ndn.bv_val, op->o_tmpmemctx );
op->o_bd = frontendDB;
rs->sr_err = frontendDB->be_modrdn( op, rs );
+#ifdef LDAP_X_TXN
+ if( rs->sr_err == LDAP_X_TXN_SPECIFY_OKAY ) {
+ /* skip cleanup */
+ }
+#endif
+
cleanup:
op->o_tmpfree( op->o_req_dn.bv_val, op->o_tmpmemctx );
op->o_tmpfree( op->o_req_ndn.bv_val, op->o_tmpmemctx );
if ( op->orr_modlist != NULL )
slap_mods_free( op->orr_modlist, 1 );
- if ( !BER_BVISNULL( &pnewSuperior ) )
+ if ( !BER_BVISNULL( &pnewSuperior ) ) {
op->o_tmpfree( pnewSuperior.bv_val, op->o_tmpmemctx );
- if ( !BER_BVISNULL( &nnewSuperior ) )
+ }
+ if ( !BER_BVISNULL( &nnewSuperior ) ) {
op->o_tmpfree( nnewSuperior.bv_val, op->o_tmpmemctx );
+ }
return rs->sr_err;
}
BerElement *ber,
ber_int_t msgid,
ber_tag_t tag,
- ber_int_t id
-)
+ ber_int_t id )
{
Operation *op;