← Back to Pull requests

Bump HikariCP and MyBatis #545

Closed
unknown closed this pull request without merging on Nov 23, 2026 14:01 UTC
View on GitHub
unknown unknown commented on Oct 30, 2026 10:43 UTC
Author

What

Bumps two stale database-layer libraries, one commit each:

| Library | From | To |
|---|---|---|
| HikariCP | 2.5.1 | 7.1.0 |
| MyBatis | 3.1.1 | 3.5.19 |

This PR originally also bumped commons-dbcp2 and commons-pool2. Main has since removed the custom DBCP pooling and the dbcp2 dependency, so that commit was dropped. The pool2 commit was dropped after review: in 2.13, GenericObjectPool.invalidateObject() always creates a replacement object, which would open an extra connection per message in File Writers with "Keep connection open" off. It can come back in its own PR together with a File connector fix.

Why

MyBatis 3.1.1 dates from 2012, and HikariCP 2.5.1 from 2016. The MyBatis bump also resolves CVE-2020-26945 / GHSA-qq48-m4jx-xqh8 (MyBatis < 3.5.6, deserialization through the second-level cache), which applies here because cacheEnabled is true in SqlMapConfig.xml. It supersedes Renovate's MyBatis 3.5.6 security update in #381, which can be closed once this merges.

Reviewer notes

  • Mapper fixes: MyBatis 3.5 binds static statements using the declared parameterType. User.selectPreferencesForUser declared java.lang.String but receives an Integer, so it's now java.lang.Integer in all 5 database mappers. This is the same fix upstream Mirth made. DebugUsage.getDebugUsageStatistics and deleteDebugUsageStatistics now declare com.mirth.connect.model.DebugUsage, which is what DefaultDebugUsageController passes (they worked either way). Every other String and Integer parameterType matches its caller.

  • SQL logging: since 3.2, MyBatis logs SQL under each statement's ID instead of the java.sql loggers, so the java.sql entry in log4j2.properties had stopped doing anything. SqlMapConfig.xml now sets logPrefix to mybatis., and that entry names mybatis, so one logger still controls all SQL logging. Its comments explain how to log one namespace and warn that DEBUG and TRACE can log PHI, stored passwords and credential hashes.

  • The #{name} bind parameters from main's event-search SQL injection fix also work under 3.5.

  • The HikariCP settings in use are unchanged in 7.1.0, and connectionTimeout(0) still means wait forever. HikariCP 7 needs only slf4j-api, which already ships.

  • Verification metadata covers the new versions, and parent POMs that only the old versions used were pruned. THIRD-PARTY-README now also lists the Javassist copy bundled inside MyBatis.
  • Release Note

    Library updates: MyBatis 3.5.19 and HikariCP 7.1.0

    These replace MyBatis 3.1.1 and HikariCP 2.5.1. The changes below are the ones that remain in the new versions and apply to the engine.

    Security

  • MyBatis 3.1.1 is affected by CVE-2020-26945 (GHSA-qq48-m4jx-xqh8), a deserialization issue in MyBatis's second-level cache. The engine's own SQL maps don't declare a cache, so they weren't exposed, but a plugin SQL map that declares <cache> was. MyBatis 3.5.6 and later also log a one-time warning the first time a cache entry is deserialized without a jdk.serialFilter set.
  • SQL logging

  • MyBatis no longer logs SQL under the java.sql loggers. Each statement now logs under mybatis.<namespace>.<statement ID>, for example mybatis.Message.getMessages: SQL and parameters at DEBUG, result rows at TRACE. The default log4j2.properties now sets logger.sql.name = mybatis, so logger.sql.level still controls all SQL logging. If an upgraded installation keeps its existing log4j2.properties, change logger.sql.name = java.sql to logger.sql.name = mybatis there. Raising a more specific logger, such as mybatis.Message, logs only those statements. At the default ERROR level nothing is logged, before or after. When SQL logging is enabled, the logger names in the log lines change accordingly, so update any log filters, parsers or alerts that match java.sql.Connection, java.sql.PreparedStatement or java.sql.ResultSet.
  • Database connection pool (HikariCP)

  • Idle connections are checked every 2 minutes (with up to 20% random variation), and dead ones are replaced. This means a little more background traffic to the database, and fewer failures from connections that a database or firewall closed while idle.

  • Connections are retired after 22.5 to 30 minutes (maxLifetime with up to 25% random variation), instead of 29.25 to 30 minutes, so connections are replaced somewhat more often.

  • More errors mark a connection as broken and remove it from the pool: SQLState 0A000, and error code 1105 from any database. An error while closing a statement left open when its connection is returned now also removes the connection, with a warning in the log.

  • If the database can't be reached when the server starts, the "Error establishing connection to database, retrying startup" message now shows a MyBatis PersistenceException ("Error getting a new connection") caused by the driver's SQLException, instead of a HikariPool$PoolInitializationException ("Failed to initialize pool"). The server still retries as before.

  • Pool log messages changed: "Starting..." / "Start completed." and "Shutdown initiated..." / "Shutdown completed." replace "Started." and "Close initiated..." / "Closed.". A new warning, "Pool is empty, failed to create/setup connection", appears after a minute of failed connection attempts. Pool thread names now use a colon, for example HikariPool-1:housekeeper. Update any log alerts or thread-dump tooling that matches the old text.
  • For plugin authors

    Plugin SQL maps and type handlers now run on MyBatis 3.5. Check for the following:

  • parameterType must match. In a statement without dynamic SQL (<if>, ${}, and so on), a simple parameterType such as java.lang.String now fixes the type handler. Calling it with a different type, such as an Integer, fails with a PersistenceException caused by a ClassCastException. Make parameterType match what the plugin passes, or remove it.

  • Duplicate type aliases stop startup. A type alias that clashes with an existing one, such as two classes with the same simple name registered through package scanning, now fails startup instead of silently replacing the earlier alias.

  • Mapper DOCTYPE system IDs must name the MyBatis DTD. MyBatis now recognizes its mapper DTD only by a DOCTYPE system ID containing mybatis-3-mapper.dtd (as in http://mybatis.org/dtd/mybatis-3-mapper.dtd, or conf/dtd/mybatis-3-mapper.dtd as the engine's own SQL maps use; the path doesn't need to exist), not by the public ID. With any other system ID, the parser tries to load the DTD from that location, and the mapper fails to load if it can't.

  • BaseTypeHandler subclasses see SQL NULL differently. MyBatis no longer calls ResultSet.wasNull() after getNullableResult, so a handler that returns 0 or false for SQL NULL now returns that value instead of null.

  • Interceptors can only intercept methods of Executor, ParameterHandler, ResultSetHandler or StatementHandler.

  • Exceptions: PersistenceException is still the exception to catch, but its message and cause chain now contain more wrapping, such as TypeException and ResultMapException.
  • Testing

  • CI runs the integration tests on Derby, MySQL, Oracle, Postgres and SQL Server.

  • Tony Germano ran the #570 smoke tests on all five databases with these two commits on current main: users and preferences, channel groups, code templates, alerts, global scripts, server settings, the configuration map, event and message browsing, the data pruner, and debugger usage statistics. Tony also tested upgrading a 4.7.0 PostgreSQL database, starting with the database down, and HikariCP keepalive and recovery after the database killed every connection.

  • Locally: build and verifyVendoredParity on these two commits, and earlier a staged server on a fresh Derby DB driven through about 30 REST calls.

  • Found while testing, already broken on main, and not touched here: GET /events/count without a level filter returns 500, with MyBatis 3.1.1 too.
  • 🤖 Generated with Claude Code

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: pacmano1 Review duration: 34757m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #545"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.5% · Safe to merge
    20.5%