Changeset 16985
- Timestamp:
- Mar 13, 2008, 12:16:21 PM (18 years ago)
- Location:
- trunk/ippTools
- Files:
-
- 1 added
- 2 edited
-
share/Makefile.am (modified) (1 diff)
-
share/camtool_reset_faulted_runs.sql (added)
-
src/camtool.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/share/Makefile.am
r16687 r16985 5 5 camtool_find_chip_id.sql \ 6 6 camtool_queue_chip_id.sql \ 7 camtool_reset_faulted_runs.sql \ 7 8 camtool_revertprocessedexp.sql \ 8 9 chiptool_completely_processed_exp.sql \ -
trunk/ippTools/src/camtool.c
r16313 r16985 647 647 PS_ASSERT_PTR_NON_NULL(config, false); 648 648 649 psString query = pxDataGet("camtool_revertprocessedexp.sql"); 649 if (!psDBTransaction(config->dbh)) { 650 psError(PS_ERR_UNKNOWN, false, "database error"); 651 return false; 652 } 653 654 { 655 psString query = pxDataGet("camtool_reset_faulted_runs.sql"); 650 656 if (!query) { 651 657 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); … … 660 666 661 667 if (!p_psDBRunQuery(config->dbh, query)) { 668 // rollback 669 if (!psDBRollback(config->dbh)) { 670 psError(PS_ERR_UNKNOWN, false, "database error"); 671 } 662 672 psError(PS_ERR_UNKNOWN, false, "database error"); 663 673 psFree(query); … … 665 675 } 666 676 psFree(query); 677 } 678 679 { 680 psString query = pxDataGet("camtool_revertprocessedexp.sql"); 681 if (!query) { 682 // rollback 683 if (!psDBRollback(config->dbh)) { 684 psError(PS_ERR_UNKNOWN, false, "database error"); 685 } 686 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 687 return false; 688 } 689 690 if (config->where) { 691 psString whereClause = psDBGenerateWhereConditionSQL(config->where, "camProcessedExp"); 692 psStringAppend(&query, " AND %s", whereClause); 693 psFree(whereClause); 694 } 695 696 if (!p_psDBRunQuery(config->dbh, query)) { 697 // rollback 698 if (!psDBRollback(config->dbh)) { 699 psError(PS_ERR_UNKNOWN, false, "database error"); 700 } 701 psError(PS_ERR_UNKNOWN, false, "database error"); 702 psFree(query); 703 return false; 704 } 705 psFree(query); 706 } 667 707 668 708 if (psDBAffectedRows(config->dbh) < 1) { 709 // rollback 710 if (!psDBRollback(config->dbh)) { 711 psError(PS_ERR_UNKNOWN, false, "database error"); 712 } 669 713 psError(PS_ERR_UNKNOWN, false, "should have affected atleast 1 row"); 714 return false; 715 } 716 717 if (!psDBCommit(config->dbh)) { 718 psError(PS_ERR_UNKNOWN, false, "database error"); 670 719 return false; 671 720 }
Note:
See TracChangeset
for help on using the changeset viewer.
