Database integrity error handling