title: How do the ExceptionSorter classes in JBoss work?
body: <p>I am wondering how the JBoss ExceptionSorter classes are able to check for database errors.</p>
  
  <p>The application (the EJB or persistence framework) is holding the reference to the database Connection, so SQLExceptions are caught by the application. How is JBoss able to see the contents of the exception?</p>
  
  <p>Does JBoss wrap the connection and intercept these messages or something like that?</p>