Yeah, I think it's a good start.
In this way we could let the SagaStarter and LocalTransaction
excecutor knows about the timeout.
As the calling thread is change, we need to tell the user about it.

Willem Jiang

Twitter: willemjiang
Weibo: 姜宁willem

On Wed, Apr 24, 2019 at 7:09 PM Zhang Lei <zhang_...@boco.com.cn> wrote:
>
> At present, Omega's timeout only stores to the database, find timeout Tx 
> transactions and compensation through database scans. This may cause the 
> commit of the Tx transaction after the compensation.
> I think it can be improved TransactionAspect class, Terminates the execution 
> of the method when the timeout and throws a custom exception
>
> So we can control the rollback of the transaction within the method when 
> timeout. I wrote an example to show my thoughts 
> https://github.com/coolbeevip/playground/tree/master/timeoutaspect-demo 
> <https://github.com/coolbeevip/playground/tree/master/timeoutaspect-demo>
>
> You can use ApplicationTest to quickly verify
>
> Any suggestion?
>
>
> Lei Zhang

Reply via email to