Changeset 13996 for branches/backtrack/ippTools/src/pxchip.c
- Timestamp:
- Jul 2, 2007, 3:57:20 PM (19 years ago)
- File:
-
- 1 edited
-
branches/backtrack/ippTools/src/pxchip.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/backtrack/ippTools/src/pxchip.c
r13994 r13996 2 2 * pxchip.c 3 3 * 4 * Copyright (C) 200 6Joshua Hoblitt4 * Copyright (C) 2007 Joshua Hoblitt 5 5 * 6 6 * This program is free software; you can redistribute it and/or modify it … … 54 54 return true; 55 55 } 56 57 58 bool pxchipQueueByExpTag(pxConfig *config, 59 psString exp_tag, 60 psString workdir, 61 psString label, 62 psString reduction, 63 psString expgroup, 64 psString dvodb) 65 { 66 PS_ASSERT_PTR_NON_NULL(config, false); 67 68 // start a transaction 69 if (!psDBTransaction(config->dbh)) { 70 psError(PS_ERR_UNKNOWN, false, "database error"); 71 return false; 72 } 73 74 // create a chipRun 75 if (!chipRunInsert(config->dbh, 76 0x0, 77 "run", // state 78 workdir, 79 "dirty", // workdir_state 80 label, 81 reduction, 82 expgroup, 83 dvodb) 84 ) { 85 // rollback 86 if (!psDBRollback(config->dbh)) { 87 psError(PS_ERR_UNKNOWN, false, "database error"); 88 } 89 psError(PS_ERR_UNKNOWN, false, "database error"); 90 return false; 91 } 92 93 #if 0 94 // get the chip_id 95 long chip_id = psDBLastInsertID(config->dbh); 96 #endif 97 98 // populate the chipPendingImfile table from rawImfile based on exp_tag, 99 // where the coresponding newExp.state entry is set to stop 100 psString query = pxDataGetCached("chiptool_queuerawimfile.sql"); 101 if (!query) { 102 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 103 return false; 104 } 105 106 // queue the imfiles for the exp_tag 107 if (!p_psDBRunQuery(config->dbh, query, exp_tag)) { 108 psError(PS_ERR_UNKNOWN, false, "database error"); 109 return false; 110 } 111 112 // just to be safe, we should have changed at least one row 113 if (psDBAffectedRows(config->dbh) < 1) { 114 psError(PS_ERR_UNKNOWN, false, 115 "no rows affected - should have changed at least one row"); 116 return false; 117 } 118 119 // point of no return 120 if (!psDBCommit(config->dbh)) { 121 psError(PS_ERR_UNKNOWN, false, "database error"); 122 return false; 123 } 124 125 return true; 126 }
Note:
See TracChangeset
for help on using the changeset viewer.
