-
Hi David, another question for you :x I tried to add some features in the Sample4 (rabbitMQ + MSSQLServer) to achieve a "real life" test. If i'm correct, a SQL Transaction is created by the SagaRunner just before the call to "HandleAsync" of a SagaState, and is commited if everithing is ok. How can i introduce, in the HandleAsync method, some business code? For example, i would like to persist an object "ShippingOrder" in the "ShippingService" during the ShippingSagaState. Should i extends / override the SagaDbContext ? If my explanation lak of details, i can try to make a branch in my fork to show what i want to achieve. Thanks a lot for all the time and efforts. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
hi Nicolas! You should not modify or use SagaDbContext outside the OpenSleigh scope, but instead create another one, specific to your application. The transactions are independent one from the other, OpenSleigh doesn't really care what you do inside the handlers, it only monitors the exceptions (if any). I would be happy to review some code if you want, that might also help creating a better sample :) |
Beta Was this translation helpful? Give feedback.
hi Nicolas! You should not modify or use SagaDbContext outside the OpenSleigh scope, but instead create another one, specific to your application. The transactions are independent one from the other, OpenSleigh doesn't really care what you do inside the handlers, it only monitors the exceptions (if any).
I would be happy to review some code if you want, that might also help creating a better sample :)