Wrapped db session in try/except