Produced by Araxis Merge on 11/14/2017 6:57:19 AM Central Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | cbs.zip\cbs\cbs\src\main\java\gov\va\cpss\job\cbs | CbsProcessStmtSystemFailureCompletionTasklet.java | Thu Nov 9 14:19:54 2017 UTC |
| 2 | cbs.zip\cbs\cbs\src\main\java\gov\va\cpss\job\cbs | CbsProcessStmtSystemFailureCompletionTasklet.java | Tue Nov 14 12:26:16 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 170 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | package go v.va.cpss. job.cbs; | |
| 2 | ||
| 3 | import sta tic gov.va .cpss.job. CbssJobPro cessingCon stants.DAT A_ERROR_ST ATUS; | |
| 4 | import sta tic gov.va .cpss.job. cbs.CbsPro cessingCon stants.CBS _TOTAL_INI TIAL_STATE MENT_COUNT _KEY; | |
| 5 | import sta tic gov.va .cpss.job. cbs.CbsPro cessingCon stants.CBS _TOTAL_REP LACED_STAT EMENT_COUN T_KEY; | |
| 6 | ||
| 7 | import org .springfra mework.bat ch.core.sc ope.contex t.ChunkCon text; | |
| 8 | ||
| 9 | import gov .va.cpss.s ervice.Cbs Service; | |
| 10 | ||
| 11 | /** | |
| 12 | * Complet e processi ng by reve rting any REPLACED s tatements to NEW sta te and | |
| 13 | * removin g the proc essed cons olidated s tatements in INITIAL state. | |
| 14 | * | |
| 15 | * @author DN S BROWNL | |
| 16 | */ | |
| 17 | public cla ss CbsProc essStmtSys temFailure Completion Tasklet ex tends CbsJ obBaseComp letionTask let { | |
| 18 | ||
| 19 | pr ivate CbsS ervice cbs Service; | |
| 20 | ||
| 21 | pu blic CbsSe rvice getC bsService( ) { | |
| 22 | retu rn cbsServ ice; | |
| 23 | } | |
| 24 | ||
| 25 | pu blic void setCbsServ ice(CbsSer vice cbsSe rvice) { | |
| 26 | this .cbsServic e = cbsSer vice; | |
| 27 | } | |
| 28 | ||
| 29 | @O verride | |
| 30 | pr otected bo olean exec uteLogic(C hunkContex t chunkCon text) { | |
| 31 | ||
| 32 | bool ean succes sful = tru e; | |
| 33 | ||
| 34 | task letLogger. info("Stmt System Fa ilure Task let Runnin g!"); | |
| 35 | ||
| 36 | // R evert REPL ACED state ments to N EW that ar e associat ed with IN ITIAL Stat ements | |
| 37 | fina l int repl acedCount = cbsServi ce.revertR eplacedSta tementsAss ociatedWit hInitialSt atements() ; | |
| 38 | ||
| 39 | // V erify the number rev erted matc hed the ru nning tota l from the writer. | |
| 40 | fina l long exp ectedRepla cedStateme ntCount = chunkConte xt.getStep Context(). getStepExe cution().g etJobExecu tion() | |
| 41 | .getExec utionConte xt().getLo ng(CBS_TOT AL_REPLACE D_STATEMEN T_COUNT_KE Y); | |
| 42 | ||
| 43 | if ( replacedCo unt == exp ectedRepla cedStateme ntCount) { | |
| 44 | taskle tLogger.in fo("Count of stateme nts revert ed to NEW (" + repla cedCount + ")"); | |
| 45 | } el se { | |
| 46 | // If the counts do not ma tch then t his is an unexpected and | |
| 47 | // unr ecoverable error. | |
| 48 | final String err or = "Roll back Trigg ered - Upd ated (" + replacedCo unt | |
| 49 | + ") REPLA CED status rows but expected t o update ( " + expect edReplaced StatementC ount | |
| 50 | + ") rows for CBSStm t"; | |
| 51 | setFai lureStatus (chunkCont ext.getSte pContext() .getStepEx ecution(). getJobExec ution(), D ATA_ERROR_ STATUS, | |
| 52 | error); | |
| 53 | ||
| 54 | // Fla g to do ro llback. | |
| 55 | succes sful = fal se; | |
| 56 | } | |
| 57 | ||
| 58 | // D elete all INITIAL st atements. | |
| 59 | fina l int dele tedCount = cbsServic e.removeIn itialState ments(); | |
| 60 | ||
| 61 | // V erify the number pub lished mat ched the r unning tot al from th e | |
| 62 | // w riter. | |
| 63 | fina l long exp ectedDelet edCount = chunkConte xt.getStep Context(). getStepExe cution().g etJobExecu tion() | |
| 64 | .getExec utionConte xt().getLo ng(CBS_TOT AL_INITIAL _STATEMENT _COUNT_KEY ); | |
| 65 | ||
| 66 | if ( deletedCou nt == expe ctedDelete dCount) { | |
| 67 | taskle tLogger.in fo("Count of initial statement s deleted (" + delet edCount + ")"); | |
| 68 | } el se { | |
| 69 | // If the counts do not ma tch then t his is an unexpected and | |
| 70 | // unr ecoverable error. | |
| 71 | final String err or = "Roll back Trigg ered - Del eted (" + deletedCou nt | |
| 72 | + ") INITI AL status rows but e xpected to delete (" + expecte dDeletedCo unt + ") r ows for CB SStmt"; | |
| 73 | setFai lureStatus (chunkCont ext.getSte pContext() .getStepEx ecution(). getJobExec ution(), D ATA_ERROR_ STATUS, | |
| 74 | error); | |
| 75 | ||
| 76 | // Fla g to do ro llback. | |
| 77 | succes sful = fal se; | |
| 78 | } | |
| 79 | ||
| 80 | // S et the com pletion st atistics. | |
| 81 | upda teStatisti cs(chunkCo ntext.getS tepContext ().getStep Execution( ).getJobEx ecution(), 0); | |
| 82 | ||
| 83 | retu rn success ful; | |
| 84 | } | |
| 85 | ||
| 86 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.