Changeset 8051
- Timestamp:
- Aug 1, 2006, 4:47:01 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/chiptool.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/chiptool.c
r8050 r8051 173 173 } 174 174 175 // start a transaction so we don't end up with an incremented iteration 176 // count but no detInputExps 177 if (!psDBTransaction(config->dbh)) { 178 psError(PS_ERR_UNKNOWN, false, "database error"); 179 psFree(valid_exp_ids); 180 return false; 181 } 182 175 183 // insert into done 176 184 for (long i = 0; i < psArrayLength(pendingImfiles); i++) { 177 185 p2DoneImfileRow *imfile = p2pendingToDoneImfile(config, pendingImfiles->data[0]); 178 186 if (!imfile) { 187 // rollback 188 if (!psDBRollback(config->dbh)) { 189 psError(PS_ERR_UNKNOWN, false, "database error"); 190 } 179 191 psError(PS_ERR_UNKNOWN, false, "failed to convert p2PendingImfile to p2DoneImfile"); 180 192 psFree(pendingImfiles); … … 182 194 } 183 195 if (!p2DoneImfileInsertObject(config->dbh, imfile)) { 196 // rollback 197 if (!psDBRollback(config->dbh)) { 198 psError(PS_ERR_UNKNOWN, false, "database error"); 199 } 184 200 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 185 201 psFree(imfile); … … 193 209 if (p2PendingImfileDeleteRowObjects(config->dbh, pendingImfiles, MAX_ROWS) < 0) { 194 210 // there must be atleast 1 Imfile to get this far 211 // rollback 212 if (!psDBRollback(config->dbh)) { 213 psError(PS_ERR_UNKNOWN, false, "database error"); 214 } 195 215 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 196 216 return false; 197 217 } 218 219 // point of no return for p2PendingImfile -> p2DoneImfile 220 if (!psDBCommit(config->dbh)) { 221 psError(PS_ERR_UNKNOWN, false, "database error"); 222 return false; 223 } 224 225 // XXX make exposure state transition transactional 198 226 199 227 // look for pending exposures
Note:
See TracChangeset
for help on using the changeset viewer.
