Description
Correctly executing or checking the state transitions for channels and transactions is nontrivial. It would be helpful to have a correct implementation of each that can be used either directly or as a reference when creating new channels or clients of channels.
Specifically, on the client side it would be nice to package the try
{ begin() ... commit() } catch { rollback() } finally { close() } code, with all the appropriate exception propagation and logging code, so that it need not be repeated constantly.On the channel side, it'd be nice to have a packaged implementation of the implied ThreadLocal semantics of the Transaction class, along with Preconditions checking to make sure that clients follow the try { begin() ... commit() }
catch
{ rollback() }finally
{ close() }pattern.