Sunday, September 24, 2006

Java Anyone?

This is a real problem I faced at work and I think it is an interesting problem. We have a batch script that runs everynight and it does a bunch of updates to our system from external systems. The batch script runs as a Java program, defined in pseudocode as follows:

public class NightlyUpdate {

public static void main(String[] args) {

try {
do update 1
}
catch (MyException ex) {
log exception ex
}

try {
do update 2
}
catch (MyException ex) {
log exception ex
}

try {
do update 3
}
catch (MyException ex) {
log exception ex
}

try {
do update 4
}
catch (MyException ex) {
log exception ex
}
}
}

Consider MyException to be an extension of the Exception class. The batch script was running fine till one fine day when it started bailing after update 1. What issues can you have with the batch script the way it is currently wrtten? What do the smart Java developers have to say?

3 comments:

Anonymous said...

Umm I'm not a smart Java developer, but was just saying hello :). I just read your post about the new groceries section, and it seems very appealing for I will possibly never have to leave my house again and haul a bunch of carrier bags back in :) yay for the interwebs!!

Hugs
RK

Anonymous said...

logfile disk full.

3ntropy

Anonymous said...

'log exception ex' in the first caused an exception to occur
-Virat