jaydebeapi icon indicating copy to clipboard operation
jaydebeapi copied to clipboard

check if autocommit is enabled for the database, and skip commit if 'yes'

Open mloyanich opened this issue 4 years ago • 0 comments

PorstgreSQL database throws an error, when you try calling commit() when the autocommit is enabled: sqlalchemy.exc.DatabaseError: (jaydebeapi.DatabaseError) org.postgresql.util.PSQLException: Cannot commit when autoCommit is enabled.

Regular psycopg2 driver ignores the commit if there is nothing to commit (which would be true in case transactions were autocommited)

Could we add the functionality to skip commit in case jconn.getAutoCommit() == True?

mloyanich avatar Dec 11 '21 22:12 mloyanich