title: Trapping Error 266 in SQL Server 2005
body: <p>Is there a way trap <a href="http://msdn.microsoft.com/en-us/library/aa258721%28SQL.80%29.aspx" rel="nofollow">error 266</a> inside JDBC or inside SQL by wrapping an exec statement in some way?</p>
  
  <p>We are looking to develop a guard around stored procedures exiting with a transaction left open in a common way.  This helps guard against programmer error that can cause significant issues when combined with connection pooling.</p>