in python, connection.in_transaction is always False.
I tried isolation_level="EXCLUSIVE" and/or "BEGIN EXCLUSIVE".
not sure if I'm doing something wrong.
also, note that auto_commit is not a parameter in connect():
TypeError: connect() got an unexpected keyword argument 'auto_commit'