/**
  * Cancel the statement with the given id.
  *
  * @param id the statement id
  */
 public void cancelStatement(int id) {
   for (Transfer transfer : transferList) {
     try {
       Transfer trans = transfer.openNewConnection();
       trans.init();
       trans.writeInt(clientVersion);
       trans.writeInt(clientVersion);
       trans.writeString(null);
       trans.writeString(null);
       trans.writeString(sessionId);
       trans.writeInt(SessionRemote.SESSION_CANCEL_STATEMENT);
       trans.writeInt(id);
       trans.close();
     } catch (IOException e) {
       trace.debug(e, "could not cancel statement");
     }
   }
 }