import { TransactionModes } from "./model.interface.js" ; import { OrmRelationBuilder } from "./orm-relation-builder.js" ; export abstract class TransactionHandling extends OrmRelationBuilder implements TransactionHandling { protected transaction : IDBTransaction | null = null ; param stores param mode param overwrite public getTransaction ( stores , mode , overwrite = false ) { if ( this . transaction === null || overwrite ) { this . transaction = this . createTransaction ( stores , mode ) ; } return this . transaction ; } param transaction public setTransaction ( transaction ) { this . transaction = transaction ; } param stores param mode public createTransaction ( stores , mode ) { const transaction = this . db . transaction ( stores , mode ) ; this . setTransaction ( transaction ) ; return transaction ; } }