Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have a product with two separate applications. The core of the product lives in the database (oracle) and runs according to a schedule. The other is a client application (currently ASP.NET MVC3) used to manage the database application. There are three levels of validation going on; client, server-side, and database before the client data is saved to the database.

However, there are cases where pieces of the data set are currently valid but could become invalid at some point in the future. In these cases rather than abort the entire (lengthy) data input process, we just place the process for the data set on hold until the data either becomes valid, or is updated to a valid value. The error might be something like, "Hey, you scheduled the copy process of data Foo to location X, and then grant access to user Bob. The Bob user account you originally selected is no longer valid, what would you like to do? 'Cancel the Copy Request' 'Change the User' or 'Wait'".

Is there a best practice for storing and reporting error conditions (fixable by the user) and exceptions (not fatal and not fixable by the user) back to the client from the database?

For example:
- Database starts process A
- Database selects data set Foo
- During process an error or exception is encountered
- Database stores the error or exception
- Database handles the abort for process A with data set Foo
- Database continues process A with next data set until all data sets are processed
- Database completes process A

Then some time later:
- User logs in to client application at a later time (after the weekend?)
- User receives notification that an error or exception occurred

My first thought is some sort of db table storing various fields (event_ time_stamp, process, event, object_type, object_pk, event_code, additional_details, status, last_updated). Then setting up client-side templates (i.e. hard coded with parameters) for each error code and presenting those to the user...but there has to be a better way?

Ideally I am looking for a solution that will allow the client to provide helpful UI options that will aid the user in possibly resolving the errors.

What solutions have you found to this problem? Would something like NServiceBus or MassTransit work?

EDIT: There are two different requirements here. The first to store the exceptions, and the second to report (and possibly take action on) them.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

This isn't quite an answer (not enough rep).

Not having experience with the two products you listed but plenty with ASP.NET, I'd say this problem sounds way too generic for a framework to address, no? Not sure if to say "generic" or "specific". I currently follow the less-then desirable approach you laid out: store errors on a db /w certain fields and display to the user. What I don't do but can extend to do is allow the user to select an entry and have them fix it. It's the "fixing" part that sounds too generic for a framework to do. Only you know what "fixing" the error means within your context and can program for that. In this case, give the user a webform to update the data and save it. I could see how the two products you mentioned can help in reporting the errors but still feel the rest requires a custom touch.

share|improve this answer
1  
You are correct in that I am looking for a two part solution, and only we, the architects, know how to direct the user to "fix" the problem. I would rather not re-invent things if possible. –  Saigework Jan 2 '13 at 18:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.