@mas-soft/mas-core-server
Version:
main application
27 lines • 835 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
class OracleTransaction {
constructor(connection) {
this.connection = connection;
if (!connection) {
throw new Error("can not start transaction because connection is null");
}
}
async commit() {
if (this.connection) {
await this.connection.commit();
await this.connection.close();
}
else {
throw new Error("can not commit because no connection opened");
}
}
async rollback() {
if (this.connection) {
await this.connection.rollback();
await this.connection.close();
}
}
}
exports.OracleTransaction = OracleTransaction;
//# sourceMappingURL=oracle-transaction.js.map