title: CommandButton action executes twice when a bean method takes a long time to respond
body: <p>I'm working on a project using Java 8, PrimeFaces 6.0 and deploy on GlassFish 4.1.</p>
  <p>I have a commandButton to call <code>testMethod</code> and has been working without any problems when the task that executes the method takes a couple of seconds or minutes. But, when the task takes 30 minutes or more the <code>testMethod</code> is executed twice (It can be seen in the server log), which is very strange.</p>
  <p>So, mi questions are:</p>
  <ul>
  <li>Why the action is executed twice with tasks that take a long time? and,</li>
  <li>How can I avoid it?</li>
  </ul>
  <pre><code>&lt;h:form id=&quot;myForm&quot;&gt;
    &lt;p:panel id=&quot;options&quot; header=&quot;OPTIONS&quot;&gt;
      &lt;div align=&quot;center&quot;&gt;
        &lt;p:commandButton id=&quot;btnVolcar&quot; action=&quot;#{testController.testMethod()}&quot; value=&quot;Send&quot; update=&quot;:growl&quot;/&gt;
      &lt;/div&gt;
    &lt;/p:panel&gt;
  &lt;/h:form&gt;
  </code></pre>
  <p>TestController:</p>
  <p>Perform database operations (call a stored procedure)</p>
  <pre><code>public String testMethod() {
      try {
          // store procedure
          testService.callToSP();
          Logger.getLogger(TestController.class.getName()).log(Level.SEVERE, null, ex);
          JsfUtil.addSuccessMessage(&quot;Success&quot;, &quot;finished&quot;);
      } catch (UnknownHostException ex) {
          Logger.getLogger(TestController.class.getName()).log(Level.SEVERE, null, ex);
          JsfUtil.addErrorMessage(ex, ex.getMessage());
      } catch (Exception ex1) {
          Logger.getLogger(TestController.class.getName()).log(Level.SEVERE, null, ex1);
      } finally {
          return URI;
      }
  }
  </code></pre>
  <p>One important thing is that it is difficult to test since when the project is run in debug mode there is no double execution.</p>