Skip to content

remove transactions from model-layer "infix" functions #133

Open
@coeit

Description

@coeit

Thanks to @framirez07 it became apparent that adding (or removing) more than 4 associated records in the add<Model> input argument for a to_many association will lead to a Operation Timeout Error.
This is because every associated record starts a transaction in the model-layer "infix" function inside a for await loop in the resolver, which causes the database (or sequelize) to do a Timeout.

To fix this bug remove the transactions from the model-layer infix functions in sql-models and sql-adapter by changing the add_ and remove_ functions as sketched below

NEW "infix" function

static async add_accessionId(measurement_id, accessionId) {
        let updated = await Measurement.update({
                accessionId: accessionId
            }, {
                where: {
                    measurement_id: measurement_id
                }
            })
        return updated;
    }

update respective unit tests

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions