View Single Post
  #2 (permalink)  
Old July 14th, 2015, 02:47 PM
nick_t nick_t is offline
Wrox Author
Points: 237, Level: 4
Points: 237, Level: 4 Points: 237, Level: 4 Points: 237, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2015
Posts: 59
Thanks: 1
Thanked 5 Times in 5 Posts
Default

Hi,

In my opinion it's a firm rule but not an absolute one. Sometimes it's best to save multiple aggregates in one transaction. But if you find yourself doing it a lot it can indicate that there are design issues with your model. It can also cause locking problems, where you are locking lots of database rows at once.

You're right about listing 21 - 15. However, this is an example where you really do have 2 aggregates being updated in the same transaction so support a genuine business policy.

We discussed these scenarios in a bit more detail in the aggregates chapter, chapter 19. Instead of saving 2 aggregates in the same transaction, we could have used asynchrony, but that would have introduced asynchrony.

Basically, sometimes its the best approach, but if you find yourself doing it a lot, I would recommend looking at your model and justifying each case.

Cheers
Reply With Quote
The Following User Says Thank You to nick_t For This Useful Post:
martinezdelariva (July 15th, 2015)