db tweaks

- sessions autocommit
- ping_connection guards against connection timeouts
- adjusted session usage to use db.transaction when writing