ruanwenjun commented on issue #16878:
URL: 
https://github.com/apache/dolphinscheduler/issues/16878#issuecomment-2741934057

   > [@ruanwenjun](https://github.com/ruanwenjun) finally i found the reason 
why the transaction didn't rollback
   > 
   >     @Transactional
   >     public IWorkflowExecutionRunnable 
createWorkflowExecuteRunnable(Command command) {
   >         deleteCommandOrThrow(command);
   >         return doCreateWorkflowExecutionRunnable(command);
   >     }
   > the `@Transactional` proxy will not roll back if the exception was not 
captured inside of the `@Transactional` proxied function
   > 
   > if capture exception like this, the transaction will work:
   > 
   >     @Transactional
   >     public IWorkflowExecutionRunnable 
createWorkflowExecuteRunnable(Command command) {
   >         try{
   >             deleteCommandOrThrow(command);
   >             return doCreateWorkflowExecutionRunnable(command);
   >         } catch (Exception e) {
   >             throw new RuntimeException(e);
   >         }
   >     }
   
   @reele It's strange, we don't have uncheck exception in this method, so all 
exception here is RuntimeException.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to