We are attempting to move to CPython from PyPy (both version 2.7), but I'm seeing some baffling errors in the process.
We are using SQLAlchemy 1.3.11, Flask-SqlAlchemy 2.4.11, psyocpg2cffi, postgres in our application.
There is an "A" model with a post create hook like:
event.listen(A.__table__, "after_create", create_default_A)
def create_default_A():
a = A(....)
db.session.add(a)
db.session.flush()
db.session.add(b)
db.session.commit()
This works fine with PyPy, however, with CPython, the commit fails with an error from postgres saying the "B" table does not exist.
As far as I understand there should be no difference. What is going wrong here?