title: Caching queries in Jooq
body: <p>I try to use jooq in a project, but for performance reasons I want to cache queries. At the user manual in <a href="http://www.jooq.org/doc/2.6/manual/sql-execution/performance-considerations/" rel="nofollow">performance consideration section</a>, query caching is mentioned but there are no examples about how it can be achieved. So i try to cache a query (for example SimpleSelectConditionStep) as following:</p>
  
  <pre><code>SimpleSelectConditionStep query = getFromPool();
  if(query != null) {
      factory.attach(query);
      query.bind(1,"John");
  } else {
     // create query
     factory.select(PERSON).where(PERSON.NAME.equal("Michael"));
  }
  // fetch and use query
  result = query.fetchOne();
  .....
  putToPool(query);
  </code></pre>
  
  <p>My software is a multi threaded web application but it is guaranteed than two different threads can not use same query at the same time (pool not return same query before it put to the pool again).</p>
  
  <p>I know than factory is not a thread safe object but I wonder that using query like this in the code can cause problems?</p>