Changeset 13990 for branches/backtrack/ippTools/src/chipqueue.c
- Timestamp:
- Jun 28, 2007, 12:01:22 PM (19 years ago)
- File:
-
- 1 edited
-
branches/backtrack/ippTools/src/chipqueue.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/backtrack/ippTools/src/chipqueue.c
r12232 r13990 23 23 24 24 #include "pxtools.h" 25 #include "pxdata.h"26 25 #include "chiptool.h" 27 26 … … 30 29 psString workdir, 31 30 psString label, 32 psString re cipe,31 psString reduction, 33 32 psString expgroup, 34 33 psString dvodb) … … 36 35 PS_ASSERT_PTR_NON_NULL(config, false); 37 36 38 // load the SQL to enqueue our exp_tags from disk once 39 static psString queuerawexp_query = NULL; 40 if (!queuerawexp_query) { 41 queuerawexp_query = pxDataGet("chiptool_queuerawexp.sql"); 42 psMemSetPersistent(queuerawexp_query, true); 43 if (!queuerawexp_query) { 44 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 45 return false; 37 // start a transaction 38 if (!psDBTransaction(config->dbh)) { 39 psError(PS_ERR_UNKNOWN, false, "database error"); 40 return false; 41 } 42 43 // create a chipRun 44 if (!chipRunInsert(config->dbh, 45 0x0, 46 "run", // state 47 workdir, 48 "dirty", // workdir_state 49 label, 50 reduction, 51 expgroup, 52 dvodb) 53 ) { 54 // rollback 55 if (!psDBRollback(config->dbh)) { 56 psError(PS_ERR_UNKNOWN, false, "database error"); 46 57 } 58 psError(PS_ERR_UNKNOWN, false, "database error"); 59 return false; 47 60 } 48 61 49 static psString queuerawimfile_query = NULL; 50 if (!queuerawimfile_query) { 51 queuerawimfile_query = pxDataGet("chiptool_queuerawimfile.sql"); 52 psMemSetPersistent(queuerawimfile_query, true); 53 if (!queuerawexp_query) { 54 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 55 return false; 56 } 62 #if 0 63 // get the chip_id 64 long chip_id = psDBLastInsertID(config->dbh); 65 #endif 66 67 // populate the chipPendingImfile table from rawImfile based on exp_tag, 68 // where the coresponding newExp.state entry is set to stop 69 psString query = pxDataGetCached("chiptool_queuerawimfile.sql"); 70 if (!query) { 71 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 72 return false; 57 73 } 58 74 59 // queue the exp 60 if (!p_psDBRunQuery(config->dbh, queuerawexp_query, 61 workdir ? workdir : "NULL", 62 label ? label : "NULL", 63 recipe ? recipe : "NULL", 64 expgroup ? expgroup : "NULL", 65 dvodb ? dvodb : "NULL", 66 exp_tag 67 )) { 75 // queue the imfiles for the exp_tag 76 if (!p_psDBRunQuery(config->dbh, query, exp_tag)) { 68 77 psError(PS_ERR_UNKNOWN, false, "database error"); 69 78 return false; … … 77 86 } 78 87 79 // queue the imfiles for the exp we just queued80 if (!p _psDBRunQuery(config->dbh, queuerawimfile_query)) {88 // point of no return 89 if (!psDBCommit(config->dbh)) { 81 90 psError(PS_ERR_UNKNOWN, false, "database error"); 82 return false;83 }84 85 // just to be safe, we should have changed at least one row86 if (psDBAffectedRows(config->dbh) < 1) {87 psError(PS_ERR_UNKNOWN, false,88 "no rows affected - should have changed at least one row");89 91 return false; 90 92 }
Note:
See TracChangeset
for help on using the changeset viewer.
