title: Why do Examples of the Repository Pattern never deal with Database Connection Exceptions?
body: <p>I've read a lot of tutorials and seen a lot of code samples regarding implementations of the <code>Repository</code> pattern. In pretty much every case, exceptions that would result from attempting to hit the database when the database is unavailable is not addressed. This seems strange considering that this is a very realistic scenario if the DB is somewhere on a network. </p>
  
  <p>So what is the best practice for handling these exceptions? </p>
  
  <ul>
  <li><p>Wrap each of those hundred calls in a try/catch, where each one might have
  the same <em>n</em> catch blocks? That's a lot of duplication, messy, error-prone, etc.</p></li>
  <li><p>Let the exceptions bubble up to the app level an catch them as
  unhandled exceptions? This makes sense if the exception is thrown on the UI thread, but otherwise, the handling of an unhandled AppDomain exception results in the app shutting down. </p></li>
  <li><p>Use a framework such as Enterprise Library's Exception
  Handling Application Block?</p></li>
  </ul>