title: Apache Camel SQL component is not closing resultset?
body: <p>I am using Camel sql component to run select queries against Oracle DB. The war file is deployed on Jboss EAP 6.1. In the config file under  configuration I have track-statements set to true (i.e. true). So Jboss checks if the result sets are closed when a connection is returned back to the pool.</p>
  
  <p>I am configuring sql component as follows:</p>
  
  <pre><code>//datasource is injected here
  @Resource(mappedName = "java:/jdbc/OracleDS")
  private DataSource dataSource;
  </code></pre>
  
  <p>...
  ...</p>
  
  <pre><code>//SQL component
  SqlComponent sqlComponent = new SqlComponent();
  sqlComponent.setDataSource(dataSource);
  camelCtx.addComponent("sql", sqlComponent);
  </code></pre>
  
  <p>The sql component is used in a recipientList as follows:</p>
  
  <pre><code>from("activemq:"+queue)
  ...
  .recipientList(simple(getFromConfig(sqlStmtName)),"false")
  ..
  </code></pre>
  
  <p>The sql statement is nothing special. Just a regular select statement from a single table.</p>
  
  <p>In Jboss logs I see this warning.   </p>
  
  <pre><code>2015-04-16 16:23:07,169 WARN     [org.jboss.jca.adapters.jdbc.WrappedConnection] (ajp-8009-2|R:r2K4crKLnPRT-0br|ctvc|1.0) Closing a result set you left open! Please close it yourself.: java.lang.Throwable: STACKTRACE
  at org.jboss.jca.adapters.jdbc.WrappedStatement.registerResultSet(WrappedStatement.java:1357)
  at org.jboss.jca.adapters.jdbc.WrappedStatement.getResultSet(WrappedStatement.java:740)
  at org.apache.camel.component.sql.SqlProducer$2.doInPreparedStatement(SqlProducer.java:127)
  at org.apache.camel.component.sql.SqlProducer$2.doInPreparedStatement(SqlProducer.java:90)
  at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:589)
  at org.apache.camel.component.sql.SqlProducer.process(SqlProducer.java:90)
  at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
  at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
  at org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:573)
  at org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:506)
  at org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:215)
  at org.apache.camel.processor.RecipientList.sendToRecipientList(RecipientList.java:167)
  at org.apache.camel.processor.RecipientList.process(RecipientList.java:120)
  at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
  at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
  at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
  at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)
  at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
  at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
  at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
  ...
  ...
  </code></pre>
  
  <hr>
  
  <p>I checked SqlProducer.java (line 127). Since sql component uses Spring JDBCtemplate I would assume that resultset would be closed by the template. </p>
  
  <p>Is there anything I need to do to close the resultset? </p>