Losing eagerloads after commit when using merged object key

Issue #1948 resolved
Former user created an issue

I'm using merge to store user objects with eagerloads in the session but when I create new objects from the merge'd data I lose my eagerloads. merge(load=False) should be preventing reconciles, but when I add a new object using the primary key from the merge'd object the merge'd object gets reconciled and my eagerloads are unloaded. See for yourself.

Comments (2)

  1. Mike Bayer repo owner

    all DB loaded attributes are expired by default when commit() is called - this so that attributes can be reloaded from the database within the new transaction (link). To disable this behavior, configure expire_on_commit=False (link).

  2. Log in to comment