inceptum-cqrs v0.21.1
Inceptum CQRS
Optimistic Locking
In short, an aggregate update will fail if the aggregate state has been changed in data storage (aggregate events are added) since the last read of the aggregate.
To use Optimistic locking ( by default ):
Set UseOptimisticLocking to true in config yml
Application:
UseOptimisticLocking: trueIn an application, each event executor needs to extend EventExecutor class
In the scenario where locking is not required meaning aggregate will be less likely to being updated concurrently by transations, optimistic locking can be turned off.
To turn off locking:
Set UseOptimisticLocking to false in config yml
Application:
UseOptimisticLocking: falseIn an application, each event executor needs to extend EventExecutorNoLocking class
Test During Local Development
It is handy to test changes in a project implementation without publishing. Follow the steps below to add the changed inceptum-cqrs as a dependency of a project:
Build and pack at inceptum-cqrs project root. Ensure to bump version in package.json before build and pack
yarn build
npm packAt inceptum-cqrs root, there should be a package created. eg inceptum-cqrs-0.20.8.tgz
Change directory to the depending project. eg:
cd ../nuntiusAdd the created package as dependency
npm install ../inceptum-cqrs/inceptum-cqrs-0.20.8.tgzThis installation may cause type confliction with existing inceptum in the project. Fix it by reinstalling all dependencies.
rm -rf node_modules && yarnDone!
7 years ago
7 years ago
7 years ago
7 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago