writeReplace

Replaces this object with a SingletonTargetSource on serialization.
Protected as otherwise it won't be invoked for subclasses.
(The writeReplace() method must be visible to the class
being serialized.)

With this implementation of this method, there is no need to mark
non-serializable fields in this class or subclasses as transient.

Serialized Fields

targetInThread

ThreadLocal holding the target associated with the current
thread. Unlike most ThreadLocals, which are static, this variable
is meant to be per thread per instance of the ThreadLocalTargetSource class.

Serialized Fields

exceptionName

Could hold exception, resolving class name but would always require FQN.
This way does multiple string comparisons, but how often do we decide
whether to roll back a transaction following an exception?