Closed daniel94104 closed 6 years ago
Hi.
Take a look at the example code. The idea is that your code should first save to an event store, and then subscribe to changes from the database. The reasoning for this is that events should not be published before events are commited. Publishing from the repository encourages publishing in the same transaction which either requires two phase commits or might be a source of bugs if different storage or bus solutions are used.
If your database supports it you can subscribe to save events, or you can pull for new events at some interval. Or if you are sure there is only one transaction involved, publish the events from the event store your self.
Does this make any sense?
Hi
Thanks for the quick reply. I used this function in our test code. So, I think I am sure there is only transaction involved. So, I think I will suppress this warning then.
Thanks again for the helpful information.
Above is the code snippet from CQRSLite domain file. I wonder if there is suggestion for alternative functions to use other than the above.
Thanks