Skip to content

SQLAlchemy is caching results #19

@JaimieMurdock

Description

@JaimieMurdock

Performing the following API requests does not result in a consistent return value, indicating some kind of cache:

GET http://localhost:6543/citation/123
# Make next PUT with some form attribute changed...
PUT http://localhost:6543/citation/123
GET http://localhost:6543/citation/123

Looking into the SQLAlchemy and Pyramid docs, this is due to a misconfigured db engine. We try to separate our model code into the pubs module, while the site mechanics reside in the pubssite module. Our Session objects in pubssite/__init__.py do not point to the same Session objects as pubs/model.py. This is causing conflicts because Pyramid doesn't know when to tell the Session to close.

From the SQLAlchemy documentation:

From the Pyramid documentation:

From StackOverflow:
How to disable SQLAlchemy caching?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions