Add ability to retry operation on exception.

While deadlocks should be corrected in the database, there are times when proactive handling of the exception is needed.  These minor changes provide an event whose handler can decide whether to retry the operation or not.