Add db config for working in Heroku
Fix autocommit problem