-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Instance XXX has been deleted. Use the make_transient() function to send this object back to the transient state. Again. #25
Comments
Also suffering from this. It wasn't a problem until i started using |
So, in Except, Do I have this right? Is there a way to remove those event listeners before the call to (I'm looking into this.) |
Yes, I was able to fix this issue by updating @request.addfinalizer
def teardown_transaction():
# Delete the session
sa.event.remove(session, 'persistent_to_detached', rehydrate_object)
sa.event.remove(session, 'deleted_to_detached', rehydrate_object)
session.remove()
# Rollback the transaction and return the connection to the pool
transaction.force_rollback()
connection.force_close()
return connection, transaction, session I am not sure whether this is a sane solution, or if it will have other side effects, though. It'd be great to have some feedback. |
I've just run into this problem myself. In particular if you're using Flask's I'm not sure I understand the case for adding deleted things back into the session anyway. I literally removed the line
So that this code only fixed on |
just like in #5 this happens again with latest versions, unfortunately #6 did not resolve this completely.
When I delete an object via a client call I receive the notorious error:
@jeancochrane could you please have a look at it?
The text was updated successfully, but these errors were encountered: