Skip to content

Problem with cache return when using project #93

@Troubelix

Description

@Troubelix

I have to compare measurement information form two a2l.

I read the first a2l

session = db.import_a2l(a2l_old)
project = Project(session)
module = project.module[0]

… , read some ecu-addresses from measurements (result ok),
then I close the session

session.close()

after reading a second a2l

session = db.import_a2l(a2l_new)
project = Project(session)
module = project.module[0]

I read the addresses from the same measurements again with:
found = next(module.measurement.query(lambda row: row.name == name), None)

But the returned addresses are the addresses from the first read a2l_old instead of these from the actual loaded a2l_new.

After a short inspection, Project build up a cache when reading the first a2l. During the request of addresses after reading the second a2l, Project returns the addresses from cache instead of these from session.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions