Currently, it doesn't appear possible to re-order module-provided advice so that it can participate in a transaction initiated by the same method call. The problem appears to be that the ServiceContext wraps already proxied spring beans with another proxy to add the advice.
To reproduce the issue:
1.) Add a bare-bones AfterReturningAdvice from a module to an
ObsService method like saveObs(...).
2.) In the advice, try calling
TransactionSynchronizationManager.isSynchronizationActive() and log
the result. If you call the service method when an enclosing
transaction is active, the call returns true. This works as expected.
3.) If you call saveObs(...) outside of an existing transaction (so
that the ObsService tx interceptor initiates a new transaction) the
call returns false. If the ordering is correct, we'd expect this to be
true as well.
4.) Try reordering the advice order so that the tx interceptor starts
the transaction before the module's advice (I tried using the Ordered