Croway opened a new pull request, #24656:
URL: https://github.com/apache/camel/pull/24656

   JIRA: https://issues.apache.org/jira/browse/CAMEL-24045
   
   `SqlProducer.processStreamList()` takes a raw connection from the DataSource 
so the result set can stay open while the exchange is routed. When 
`PreparedStatement.execute()` returns `false` (INSERT/UPDATE/DELETE/DDL), the 
result-set branch was skipped: no `ResultSetIteratorCompletion` was registered 
and neither the connection nor the statement was ever closed — the catch block 
only cleaned up on exception. Since the executed SQL can vary per exchange via 
the `CamelSqlQuery` header or `useMessageBodyForSql=true`, each such exchange 
leaked one pooled connection, eventually exhausting the pool.
   
   Changes:
   - Close the statement and return the connection to the pool when the 
executed statement produced no result set
   - New test with a connection-counting DataSource proving no connection stays 
open after the exchange completes (fails on current `main`, passes with the 
fix); existing StreamList producer/consumer tests unaffected
   
   _Claude Code on behalf of Croway_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to