try-catch around DB accesses

Printing errors in the logger, better thank a stack trace.