Why is it no longer accepted? O A.
If you post the full traceback, it would be helpful.The problem is in the way you create the session.I don't see how you can use create_session if you're using sessionmaker.Session class is created, you need to instantiate it.So:
As I had autocommit set to True, the error occurred.The issue was resolved by setting autocommit to false.