decorator to manage db sessions
Automatically open and close sessions with a catch to help prevent the database from corrupting after an error
Automatically open and close sessions with a catch to help prevent the database from corrupting after an error