struct bdb_info *bdb = (struct bdb_info *) be->be_private;
        struct berval   pdn;
        Entry           *p = NULL;
-       int             rc, ret; 
+       int             rc; 
        const char      *text;
        char textbuf[SLAP_TEXT_BUFLEN];
        size_t textlen = sizeof textbuf;
        u_int32_t       lockid;
        DB_LOCK         lock;
 #endif
+       int             noop = 0;
 
 #ifdef NEW_LOGGING
        LDAP_LOG ( OPERATION, ARGS, "==> bdb_add: %s\n", e->e_dn, 0, 0 );
                if (( rc=TXN_ABORT( ltid )) != 0 ) {
                        text = "txn_abort (no-op) failed";
                } else {
+                       noop = 1;
                        rc = LDAP_SUCCESS;
                }
 
                        text = "txn_prepare failed";
 
                } else {
-                       ret = bdb_cache_add_entry_rw(bdb->bi_dbenv, &bdb->bi_cache, e, CACHE_WRITE_LOCK, locker, &lock);
+                       int ret = bdb_cache_add_entry_rw(bdb->bi_dbenv,
+                                       &bdb->bi_cache, e, CACHE_WRITE_LOCK,
+                                       locker, &lock);
 #if 0
                        if ( bdb_cache_add_entry_rw(&bdb->bi_cache,
                                e, CACHE_WRITE_LOCK) != 0 )
                        op->o_noop ? " (no-op)" : "", e->e_id, e->e_dn );
 #endif
                text = NULL;
-               bdb_cache_entry_commit( e );
+               if ( !noop ) {
+                       bdb_cache_entry_commit( e );
+               }
        }
        else {
 #ifdef NEW_LOGGING
                op->o_private = NULL;
        }
 
-       return rc;
+       return ( ( rc == LDAP_SUCCESS ) ? noop : rc );
 }
 
        DB_LOCK         lock;
 #endif
 
+       int             noop = 0;
+
 #ifdef NEW_LOGGING
        LDAP_LOG ( OPERATION, ARGS,  "==> bdb_delete: %s\n", dn->bv_val, 0, 0 );
 #else
 #endif
 
        if( op->o_noop ) {
-               rc = TXN_ABORT( ltid );
+               if ( ( rc = TXN_ABORT( ltid ) ) != 0 ) {
+                       text = "txn_abort (no-op) failed";
+               } else {
+                       noop = 1;
+                       rc = LDAP_SUCCESS;
+               }
        } else {
                rc = TXN_COMMIT( ltid, 0 );
        }
                op->o_private = NULL;
        }
 
-       return rc;
+       return ( ( rc == LDAP_SUCCESS ) ? noop : rc );
 }
 
        u_int32_t       locker;
        DB_LOCK         lock;
 
+       int             noop = 0;
+
 #ifdef NEW_LOGGING
        LDAP_LOG ( OPERATION, ENTRY, "bdb_modify: %s\n", dn->bv_val, 0, 0 );
 #else
        }
 
        if( op->o_noop ) {
-               rc = TXN_ABORT( ltid );
+               if ( ( rc = TXN_ABORT( ltid ) ) != 0 ) {
+                       text = "txn_abort (no-op) failed";
+               } else {
+                       noop = 1;
+                       rc = LDAP_SUCCESS;
+               }
        } else {
                rc = TXN_COMMIT( ltid, 0 );
        }
        if( e != NULL ) {
                bdb_unlocked_cache_return_entry_w (&bdb->bi_cache, e);
        }
-       return rc;
+       return ( ( rc == LDAP_SUCCESS ) ? noop : rc );
 }
 
        u_int32_t       locker;
        DB_LOCK         lock;
 
+       int             noop = 0;
+
 #ifdef NEW_LOGGING
        LDAP_LOG ( OPERATION, ENTRY, "==>bdb_modrdn(%s,%s,%s)\n", 
                dn->bv_val,newrdn->bv_val, newSuperior ? newSuperior->bv_val : "NULL" );
                if(( rc=TXN_ABORT( ltid )) != 0 ) {
                        text = "txn_abort (no-op) failed";
                } else {
+                       noop = 1;
                        rc = LDAP_SUCCESS;
                }
 
                op->o_private = NULL;
        }
 
-       return rc;
+       return ( ( rc == LDAP_SUCCESS ) ? noop : rc );
 }