Produced by Araxis Merge on 2/7/2017 12:14:06 PM Eastern 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 | cpss.zip\cpss\src\main\java\gov\va\cpss\job\cbs | CbsProcessStmtSystemFailureRecoveryTasklet.java | Wed Feb 1 21:07:30 2017 UTC |
2 | cpss.zip\cpss\src\main\java\gov\va\cpss\job\cbs | CbsProcessStmtSystemFailureRecoveryTasklet.java | Fri Feb 3 20:41:48 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 | ||
5 | import org .springfra mework.bat ch.core.Ex itStatus; | |
6 | import org .springfra mework.bat ch.core.sc ope.contex t.ChunkCon text; | |
7 | ||
8 | import gov .va.cpss.s ervice.Cbs Service; | |
9 | ||
10 | /** | |
11 | * Recover previous partial pr ocessing b y revertin g any REPL ACED state ments to | |
12 | * NEW sta te and rem oving the processed consolidat ed stateme nts in INI TIAL | |
13 | * state. | |
14 | * | |
15 | * @author DN S P II | |
16 | */ | |
17 | public cla ss CbsProc essStmtSys temFailure RecoveryTa sklet exte nds CbsJob BaseComple tionTaskle t { | |
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 Reco very Taskl et Running !"); | |
35 | ||
36 | // R evert REPL ACED state ments to N EW that ar e associat ed with IN ITIAL | |
37 | // S tatements | |
38 | fina l int repl acedCount = cbsServi ce.revertR eplacedSta tementsAss ociatedWit hInitialSt atements() ; | |
39 | ||
40 | if ( successful && (repla cedCount > = 0)) { | |
41 | taskle tLogger.in fo("Count of stateme nts revert ed to NEW (" + repla cedCount + ")"); | |
42 | } el se { | |
43 | // unr ecoverable error. | |
44 | final String err or = "Roll back Trigg ered - Err or occurre d revertin g REPLACED status ro ws for CBS Stmt: " | |
45 | + replaced Count; | |
46 | setFai lureStatus (chunkCont ext.getSte pContext() .getStepEx ecution(). getJobExec ution(), D ATA_ERROR_ STATUS, | |
47 | error); | |
48 | ||
49 | // Fla g to do ro llback. | |
50 | succes sful = fal se; | |
51 | } | |
52 | ||
53 | // D elete all INITIAL st atements. | |
54 | fina l int dele tedCount = cbsServic e.removeIn itialState ments(); | |
55 | ||
56 | if ( successful && (delet edCount >= 0)) { | |
57 | taskle tLogger.in fo("Count of initial statement s deleted (" + delet edCount + ")"); | |
58 | } el se { | |
59 | // unr ecoverable error. | |
60 | final String err or = "Roll back Trigg ered - Err or occurre d deleting INITIAL s tatus rows for CBSSt mt: " | |
61 | + deletedC ount; | |
62 | setFai lureStatus (chunkCont ext.getSte pContext() .getStepEx ecution(). getJobExec ution(), D ATA_ERROR_ STATUS, | |
63 | error); | |
64 | ||
65 | // Fla g to do ro llback. | |
66 | succes sful = fal se; | |
67 | } | |
68 | ||
69 | // S et exit st atus of th is tasklet to FAILED if not su ccessful. | |
70 | if ( successful ) { | |
71 | ||
72 | taskle tLogger.in fo("Stmt S ystem Fail ure Recove ry Tasklet was Succe ssful"); | |
73 | ||
74 | } el se { | |
75 | ||
76 | // Set the compl etion stat istics to zero since the job f ailed. | |
77 | update Statistics (chunkCont ext.getSte pContext() .getStepEx ecution(). getJobExec ution(), 0 ); | |
78 | ||
79 | taskle tLogger.er ror("Stmt System Fai lure Recov ery Taskle t Detected an Unreco verable Fa ilure"); | |
80 | chunkC ontext.get StepContex t().getSte pExecution ().setExit Status(Exi tStatus.FA ILED); | |
81 | } | |
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.