Wrap db access with try..catch statements