Currently, programs have little control over when a transaction begins and ends, how long the transaction timeout is, or whether a method needs a transaction at all:
- flowlets and service handler methods, as well as program lifecycle methods are always executed in a (short) transaction with the transaction timeout configured in cdap-site.xml
- workers and custom workflow action have explicit control over transactions via the Transactional.execute() interface. But cannot control the timeout.
We need to make the timeout configurable through configuration as well as programmatically:
- add a way to configure the timeout at a finer granularity
- add methods to Transactional that allow a custom timeout or no timeout
- add add a way for flowlet, handler and lifecycle methods to use Transactional instead of an implicit transaction.