Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Java Exception Handling Flow Control

807580Aug 2 2010 — edited Aug 4 2010
Hi,

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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 1 2010
Added on Aug 2 2010
6 comments
254 views