IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 24, 2006, 4:29:23 PM (20 years ago)
Author:
jhoblitt
Message:

change copydoneMode() to be transactional

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/pztool.c

    r7921 r7969  
    126126    }
    127127
    128     // XXX start transaction
     128    // start a transaction so we don't end up with entries in newImfile that
     129    // haven't been removed from pzPendingImfile
     130    if (!psDBTransaction(config->dbh)) {
     131        psError(PS_ERR_UNKNOWN, false, "database error");
     132        psFree(pending);
     133        return false;
     134    }
    129135
    130136    for (long i = 0; i < pending->n; i++) {
     
    140146        if (!newImfileInsertObject(config->dbh, newImfile)) {
    141147            psError(PS_ERR_UNKNOWN, false, "dbh access failed");
     148            psFree(newImfile);
    142149            return false;
    143150        }
     151
     152        psFree(newImfile);
    144153    }
    145154
    146155    if (pzPendingImfileDeleteRowObjects(config->dbh, pending, MAX_ROWS)
    147156        < 0) {
    148             psError(PS_ERR_UNKNOWN, false, "dbh access failed");
    149             return false;
    150     }
    151 
    152     // XXX commit transaction
     157        psError(PS_ERR_UNKNOWN, false, "dbh access failed");
     158        psFree(pending);
     159        return false;
     160    }
     161    psFree(pending);
     162
     163    // point of no return
     164    if (!psDBCommit(config->dbh)) {
     165        psError(PS_ERR_UNKNOWN, false, "database error");
     166        return false;
     167    }
    153168
    154169    // check for completed exps
Note: See TracChangeset for help on using the changeset viewer.