You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using new interface inside some service method like this (taken from examples in README)
class Service(object):
name = "service"
db = Database(DeclarativeBase)
sentry = SentryReporter()
@entrypoint
def write_to_db(self):
model = Model(...)
with self.db.get_session() as session:
session.add(model)
raise Exception()
if any exception is raised inside with block and service instance has nameko-sentry DP this will trigger Instance <Model at 0x7fe4de51b240> is not bound to a Session when raven wants to stringify this object (repr wants instance's primary key) because the session is closed after context block is over.
Is there a reason to close a session in context manager?
Secondly there might be some misunderstanding from the documentation because it says
As a context manager that issues a commit or rollback on exit:
But not a word about that session is closed and all instances are invalidated.
The text was updated successfully, but these errors were encountered:
When using new interface inside some service method like this (taken from examples in README)
if any exception is raised inside with block and service instance has nameko-sentry DP this will trigger
Instance <Model at 0x7fe4de51b240> is not bound to a Session
when raven wants to stringify this object (repr wants instance's primary key) because the session is closed after context block is over.Is there a reason to close a session in context manager?
Secondly there might be some misunderstanding from the documentation because it says
But not a word about that session is closed and all instances are invalidated.
The text was updated successfully, but these errors were encountered: