jmeter icon indicating copy to clipboard operation
jmeter copied to clipboard

feat: use HikariCP instead of commons-dbcp2 for connection pooling

Open vlsi opened this issue 2 months ago • 0 comments

Motivation and Context

commons-dbcp2 seems to be to heavyweight, and the newer versions pull jakarta.transaction for unknown reasons. Let's stick with a well-known faster and smaller pool.

There's an issue with the current JMeter implementation: it seems to rely on transactions (==uncommitted data within connections), however, it does not manage the transactions properly. JMeter should have dedicated JdbcTransaction or JtaTransaction elements (e.g. like @Transactional Spring), so JDBC samplers within that JdbcTransaction controller would reuse the same transaction.

Currently, JMeter borrows and releases a connection to the pool for every JDBC sampler execution, thus it can't reliably work with transactions. There's no guarantee that subsequent "borrow" would borrow the same connection. The connection pooler should rollback a dirty connection on release anyways.

So the change looks bigger than I initially planned.

TODO:

  • [ ] Add JdbcTransaction controller element so it would keep a connection

vlsi avatar Nov 04 '25 11:11 vlsi