Bug 164343 - [DataBinding] Realm needs consistent Exception handling strategy
Summary: [DataBinding] Realm needs consistent Exception handling strategy
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.3 M5   Edit
Assignee: Boris Bokowski CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2006-11-13 11:58 EST by Boris Bokowski CLA
Modified: 2007-02-04 23:22 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Boris Bokowski CLA 2006-11-13 11:58:37 EST
Copied from bug 116920 comment #34:

Just stumbled upon this bug via Brad's blog. I like concurrency problems and I
was looking over the Realm implementation. I just have one concern. It looks
like the abstract impl of Realm doesn't have a consistent Exception handling
strategy. There are two main entry points into Realm, asyncExec() and exec().
In exec(), if you are on the isCurrent() thread, the runnable is executed
directly. If an exception happens here, it will spill out of the exec() method
into the caller. If you are isCurrent(), it will async() the runnable. By it's
vary nature, there can be no exception handling since it's executed on a
different thread. 

It's nice that since you're dealing with Runnables they can't return a value.
However, it might be important to know that the runnable actually did execute
successfully. My suggestion is that you add the ability to register an
"Exception handler" with the Realm. To be consistent, it should apply to both
sync() and async() versions of execution. This will allow the caller to handle
exceptions appropriately - at a minimum, they could log it. 

This could come in handy for the impl of DisplayRealm. So if a runtime
exception happens during the runnable - it would just say "Unhandled exception
occured while processing event loop" or whatever that message is.
Comment 1 Boris Bokowski CLA 2006-12-12 14:19:26 EST
Thanks for the suggestion.  Makes sense - we should add API for this before M5.
Comment 2 Boris Bokowski CLA 2007-01-27 22:54:11 EST
Question: Should the exception handling be configurable per Realm instance, or per Runnable that you pass in?
Comment 3 Boris Bokowski CLA 2007-02-04 23:22:47 EST
Fixed >20070204.