typeorm-transactional-async-callbacks
Version:
A Transactional Method Decorator for typeorm that uses cls-hooked to handle and propagate transactions between different repositories and service methods. Inpired by Spring Trasnactional Annotation and Sequelize CLS
38 lines • 1.38 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.Propagation = void 0;
/**
* Enumeration that represents transaction propagation behaviors for use with the see {@link Transactional} annotation
*/
var Propagation;
(function (Propagation) {
/**
* Support a current transaction, throw an exception if none exists.
*/
Propagation["MANDATORY"] = "MANDATORY";
/**
* Execute within a nested transaction if a current transaction exists, behave like `REQUIRED` else.
*/
Propagation["NESTED"] = "NESTED";
/**
* Execute non-transactionally, throw an exception if a transaction exists.
*/
Propagation["NEVER"] = "NEVER";
/**
* Execute non-transactionally, suspend the current transaction if one exists.
*/
Propagation["NOT_SUPPORTED"] = "NOT_SUPPORTED";
/**
* Support a current transaction, create a new one if none exists.
*/
Propagation["REQUIRED"] = "REQUIRED";
/**
* Create a new transaction, and suspend the current transaction if one exists.
*/
Propagation["REQUIRES_NEW"] = "REQUIRES_NEW";
/**
* Support a current transaction, execute non-transactionally if none exists.
*/
Propagation["SUPPORTS"] = "SUPPORTS";
})(Propagation = exports.Propagation || (exports.Propagation = {}));
//# sourceMappingURL=propagation.js.map
;