title: JMeter - alternatives to using While Controller with JDBC Request Child?
body: <p>My environment: JMeter v2.11, Oracle 12, JDK 7</p>
  
  <p>System: 8000 XML submissions / hour, writes to the database, then after some internal processing, status value in DB is updated (indicating the submission/application has been approved).  I have some beanshell samplers setup to source values from a csv file to emulate the XML submission and I have JDBC Request to check when the database status attribute has been updated.</p>
  
  <p>The JDBC request is contained within a While Controller at the end of my thread so that my JDBC request executes until the application.status column is updated.</p>
  
  <p>My test runs fine for a single instance (1 loop) but for subsequent loops, the JDBC request is NOT executed.  That is, if the loop count is greater than 1, for each subsequent loop, the JDBC request is NOT executed.</p>
  
  <p>My current setup:</p>
  
  <pre><code>Thread Group: No. of Users--&gt;1, Loop Count --&gt;3
  -CSV Data Config: Recycle on EOF = TRUE, STOP THREAD ON EOF = FALSE
  -Beanshell Samplers: (to create and submit the XML, using csv data)
  --While Controller: (${__javaScript("${status_1}" != "6")})
  ---JDBC Request: select status from application where applicationID = (select max(applicationID) from application); VariableName: status
  </code></pre>
  
  <p>As I stated above - the thread runs fine for Loop=1, but if Loop>1 is set, then subsequent loops do NOT execute the JDBC request because of it's relationship to the While Controller.</p>
  
  <p>I've tried adding a parent Simple Controller to the While Controller, I've tried using multiple Loop Controllers and setting a parent Loop Controller to the While Controller but nothing I do works, and I just don't know how to proceed.</p>
  
  <p>I have spent 3 days (really! 3 days!) searching the web for a way to get the While Controller included in subsequent loops - I've found only 3 instances of this question ever being asked on forums going back to 2006, but each question was never actually answered.</p>
  
  <p>It even crossed my mind to create 8000 Thread Groups with a loop of 1!!. It would be a nightmare but would in fact get done what I need - but obviously I'd be here til next year setting that up and I suspect JMeter would run out of resource trying to execute all those thread groups.</p>
  
  <p>Can anyone advise as to some alternatives to my approach.  I'm starting to believe the While Controller not being included in subsequent loops is expected/standard JMeter functionality. </p>
  
  <p>Perhaps I can use some other controllers to do what I need?</p>
  
  <p>As always, any help, advice, hints, tips are gratefully appreciated.</p>