code: private void yieldConAndHandleException
          (CodeBuilder b,
           LocalVariable capVar,
           Label tryBeforeCon, LocalVariable conVar, Label tryAfterCon,
           boolean forPersist)
      {
          Label endFinallyLabel = b.createLabel().setLocation();
          Label contLabel = b.createLabel();
  
          yieldConnection(b, capVar, conVar);
          b.branch(contLabel);
  
          b.exceptionHandler(tryAfterCon, endFinallyLabel, null);
          yieldConnection(b, capVar, conVar);
          b.throwObject();
  
          b.exceptionHandler
              (tryBeforeCon, b.createLabel().setLocation(), RuntimeException.class.getName());
          b.throwObject();
  
          b.exceptionHandler
              (tryBeforeCon, b.createLabel().setLocation(), Exception.class.getName());
          b.loadLocal(capVar);
          // Swap exception object and JDBCConnectionCapability instance.
          b.swap();
          TypeDesc[] params = {TypeDesc.forClass(Throwable.class)};
          if (forPersist) {
              b.invokeInterface(TypeDesc.forClass(JDBCConnectionCapability.class),
                                "toPersistException",
                                TypeDesc.forClass(PersistException.class), params);
          } else {
              b.invokeInterface(TypeDesc.forClass(JDBCConnectionCapability.class),
                                "toFetchException",
                                TypeDesc.forClass(FetchException.class), params);
          }
          b.throwObject();
  
          contLabel.setLocation();
      }
docs: Generates code which emulates this:
  
  ...
  } finally {
  JDBCConnectionCapability.yieldConnection(con);
  }
  } catch (RuntimeException e) {
  throw e;
  } catch (Exception e) {
  throw JDBCConnectionCapability.toFetchException(e);
  }
  
  @param capVar required reference to JDBCConnectionCapability
  @param txnVar optional transaction variable to commit/exit
  @param tryBeforeCon label right before connection acquisition
  @param conVar optional connection variable
  @param tryAfterCon label right after connection acquisition