Currently, when the program's initialize() method calls addInput() or addOutput(), we only remember what the input or output is; we then call the corresponding dataset after initialize() returns to determine the configuration for the inputs and output. But if initialize uses explicit transactions, that means that this second step happens in a different transaction than where it was invoked. That can lead to unexpected behavior.
So far, this could not be done much differently, because we also allowed setInput/OutputDataset() inside configure(), which does not have a transaction. These are removed by
CDAP-7475, allowing for this refactoring is 4.0.