commit after (almost) every database access to avoid "idle in transaction"...
commit after (almost) every database access to avoid "idle in transaction" state of the database connections/sessions
commit after (almost) every database access to avoid "idle in transaction" state of the database connections/sessions