code: public void close() {
          try {
              state = "CLOSING";
              if( connection != null ) {
                  logger.warn("Connection not committed, rolling back.");
                  rollback();
              }
              if( !events.empty() ) {
                  state = "CLOSING EVENTS";
                  do {
                      Execution exec = (Execution)events.pop();
                  
                      try {
                          Stack<Execution> stack;
                          
                          exec.close();
                          stack = eventCache.get(exec.getClass().getName());
                          if( stack != null ) {
                              stack.push(exec);
                          }
                      }
                      catch( Throwable t ) {
                          logger.error(t.getMessage(), t);
                      }
                  } while( !events.empty() );
              }
              state = "CLOSED";
          }
          finally {
              if (tracking) {
                  transactions.remove(new Integer(transactionId));
              }
              events.clear();
              statements.clear();
              stackTrace = null;
          }
      }
docs: Closes the transaction. If the transaction has not been committed,
  it is rolled back.