catch commit exepctions when accessing db