Apache Camel SQL 组件没有关闭结果集?
Apache Camel SQL component is not closing resultset?
我正在使用 Camel sql 组件对 Oracle 数据库进行 运行 select 查询。 war 文件部署在 Jboss EAP 6.1 上。在配置下的配置文件中,我将 track-statements 设置为 true(即 true)。因此 Jboss 检查当连接返回池时结果集是否关闭。
我正在配置 sql 组件如下:
//datasource is injected here
@Resource(mappedName = "java:/jdbc/OracleDS")
private DataSource dataSource;
...
...
//SQL component
SqlComponent sqlComponent = new SqlComponent();
sqlComponent.setDataSource(dataSource);
camelCtx.addComponent("sql", sqlComponent);
sql 组件在 recipientList 中的使用如下:
from("activemq:"+queue)
...
.recipientList(simple(getFromConfig(sqlStmtName)),"false")
..
sql 语句没什么特别的。只是来自单个 table.
的常规 select 语句
在 Jboss 日志中我看到了这个 warning。
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.doInPreparedStatement(SqlProducer.java:127)
at org.apache.camel.component.sql.SqlProducer.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)
...
...
我检查了 SqlProducer.java(第 127 行)。由于 sql 组件使用 Spring JDBCtemplate,我假设结果集将被模板关闭。
我需要做什么来关闭结果集吗?
是的,这是 Apache Camel 中的一个错误。我已经记录了一张票以在未来的版本中修复此问题
我正在使用 Camel sql 组件对 Oracle 数据库进行 运行 select 查询。 war 文件部署在 Jboss EAP 6.1 上。在配置下的配置文件中,我将 track-statements 设置为 true(即 true)。因此 Jboss 检查当连接返回池时结果集是否关闭。
我正在配置 sql 组件如下:
//datasource is injected here
@Resource(mappedName = "java:/jdbc/OracleDS")
private DataSource dataSource;
... ...
//SQL component
SqlComponent sqlComponent = new SqlComponent();
sqlComponent.setDataSource(dataSource);
camelCtx.addComponent("sql", sqlComponent);
sql 组件在 recipientList 中的使用如下:
from("activemq:"+queue)
...
.recipientList(simple(getFromConfig(sqlStmtName)),"false")
..
sql 语句没什么特别的。只是来自单个 table.
的常规 select 语句在 Jboss 日志中我看到了这个 warning。
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.doInPreparedStatement(SqlProducer.java:127)
at org.apache.camel.component.sql.SqlProducer.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)
...
...
我检查了 SqlProducer.java(第 127 行)。由于 sql 组件使用 Spring JDBCtemplate,我假设结果集将被模板关闭。
我需要做什么来关闭结果集吗?
是的,这是 Apache Camel 中的一个错误。我已经记录了一张票以在未来的版本中修复此问题