Skip to content

Instantly share code, notes, and snippets.

@bitness
bitness / errtest.py
Created October 2, 2015 22:26
sqlalchemy and psycopg2: unexpected flush and rollback in begin_nested()
#!/usr/bin/env python
from sqlalchemy import exc, create_engine, Column, String, ForeignKey
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.ext.declarative import declarative_base
engine = create_engine('postgresql://someone@localhost/errtest')
session_factory = sessionmaker(bind=engine)
Session = scoped_session(session_factory)

Keybase proof

I hereby claim:

  • I am bitness on github.
  • I am ldamerow (https://keybase.io/ldamerow) on keybase.
  • I have a public key whose fingerprint is F29F 160D B23C 3237 1BA3 FCD5 4E13 C775 36B3 ABCA

To claim this, I am signing this object: