Understanding the UoW system
UoW is the main system that ABP uses to initiate, manage, and dispose of database connections and transactions. The UoW system is designed with the Ambient Context pattern. That means when we create a new UoW, it creates a scoped context that is participated by all the database operations performed in the current scope by sharing the same context and is considered a single transaction boundary. All the operations done in a UoW are committed (on success) or rolled back (on exception) together.
While you can manually create UoW scopes and control the transaction properties, most of the time, it works seamlessly just as you desire. However, it provides some options if you change the default behavior.
UoW and Database Operations
All database operations must be performed in a UoW scope since UoW is the way to manage database connections and transactions in ABP Framework. Otherwise, you get an exception indicating that.
In the next sections, you will...