Java Exception Handling Flow Control
807580Aug 2 2010 — edited Aug 4 2010Hi,
I've spent a couple of days trying to solve this problem and wonder if perhaps my design is flawed. Basically, this is what my app does.
Class A - Begins by inserting a record into a process table in the database (Oracle 10g) that stores the begin time, status type of "In Progress", and other info
Class A calls Class B
Class B calls Class C
Returns to Class A which updates the record in the process table to give it a complete time, status type of "Successfully Completed", etc.
That works fine, but what if the following scenario occurred?
Class A - Begins by inserting a record into a process table in the database (Oracle 10g) that stores the begin time, status type of "In Progress", and other info
Class A calls Class B
Class B calls Class C
An error occurs in Class C and is caught using try/catch/finally
How can I write the app so that it will return to Class A (which contains the key to the record in the process table) and update the record in the process table so that it has a status type of "Error" ? Is my objective flawed somwhere? I would appreciate any insight. Thanks so much.