69c9f3b Ticket #211 - dnaNextValue gets incremented even if the user addition fails

Authored and Committed by mreynolds 12 years ago
    Ticket #211 - dnaNextValue gets incremented even if the user addition fails
    
    Bug Description:  During the pre-op stage we were allocating and assigning
                      the next dna value to the entry.  If the user add, or modify
                      fails in the backend(schema check, etc), then we just lost
                      the value from the range.
    
    Fix Description:  Now we do the value allocation and assignment in a new
                      backend_txn_preop function.  At this stage most failures
                      would already have occurred.
    
                      However, in the preop we still need to assign a value to
                      the dnaType, or else we will fail the schema check in the
                      backend.  We set the type to DNA_NEEDS_UPDATE, and in the
                      be_txn_preop function, we check for this to assign the
                      real value.   We also need to get the next range of
                      values, if needed, in the preop as well.
    
                      Since we are changing the mods in pre_op, in ldbm_modify
                      we need to grab the mods again after processing the
                      be_txn_preop functions for index_add_mods().  For the
                      ldbm operations get copies of the original entries/mods/pb params
                      and restore them if we hit a DB_LOCK_DEADLOCK.
    
    https://fedorahosted.org/389/ticket/211
    
    Reviewed by:  richm and nhosoi (Thanks!)
    
        
file modified
+460 -156