Skip to content

Commit 8fbe423

Browse files
committed
amend! Bump mybatis to 3.5.19
Bump mybatis to 3.5.19 3.1.1 is from 2012. 3.5.19 is the last Java 8 release of the 3.5 line. 3.6.0 is only days old, so this stays on 3.5. OGNL and javassist are still shaded inside the mybatis jar, and nothing else is needed at runtime. The 3.5 line binds a simple parameterType's type handler from the declared type. User.selectPreferencesForUser declared java.lang.String but is called with the Integer user id, so it now declares java.lang.Integer in every database's mapper. Upstream Mirth made the same change when it moved to 3.5.15. DebugUsage.getDebugUsageStatistics and deleteDebugUsageStatistics declared java.lang.String but are called with a DebugUsage, so they now declare that class; they worked either way, because the serverId property they read is a String. The other String and Integer parameterTypes match what their callers pass. MyBatis stopped logging SQL under the java.sql loggers in 3.2 and logs each statement under its own ID instead, so the java.sql entry in log4j2.properties had no effect any more. logPrefix is now set, so every statement logs under mybatis.<namespace>.<id>, and that entry now names mybatis, so one logger still controls all SQL logging. The comments there now explain how to log a single namespace and warn that DEBUG and TRACE can write sensitive data to the logs. mybatis-parent 15 was only the parent of 3.1.1, so its checksum entry is replaced by mybatis-parent 48, the parent of 3.5.19. Signed-off-by: Nico Piel <nicopiel@mailbox.org> Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Tony Germano <tony@germano.name>
1 parent a909540 commit 8fbe423

7 files changed

Lines changed: 24 additions & 11 deletions

File tree

‎server/conf/log4j2.properties‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,17 @@ logger.shutdown.name = shutdown
6363
logger.shutdown.level = DEBUG
6464

6565
# SQL Logging
66-
logger.sql.name = java.sql
66+
# MyBatis logs each statement under mybatis.<namespace>.<statement ID>.
67+
# DEBUG logs the SQL and its parameters; TRACE also logs every row returned.
68+
# To log only one namespace, leave logger.sql at ERROR and add a logger for
69+
# that namespace, for example:
70+
# logger.sqlMessage.name = mybatis.Message
71+
# logger.sqlMessage.level = DEBUG
72+
# Core namespaces: Alert, Channel, CodeTemplate, Configuration, DebugUsage,
73+
# Event, Message, Script, User. Plugins may add their own.
74+
# WARNING: at DEBUG or TRACE, the logged parameters and rows can include
75+
# message content (which may contain PHI), channel and server configuration
76+
# (including passwords stored in it), and user credential hashes. Enable it
77+
# only while troubleshooting, and protect or delete the resulting logs.
78+
logger.sql.name = mybatis
6779
logger.sql.level = ERROR

‎server/dbconf/SqlMapConfig.xml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<settings>
66
<setting name="cacheEnabled" value="true" />
77
<setting name="jdbcTypeForNull" value="VARCHAR" />
8+
<setting name="logPrefix" value="mybatis." />
89
</settings>
910

1011
<typeAliases>

‎server/dbconf/derby/derby-debugusage.xml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<result property='invocationCount' column='INVOCATION_COUNT'/>
1313
</resultMap>
1414
<select id='getDebugUsageStatistics'
15-
parameterType='java.lang.String'
15+
parameterType='com.mirth.connect.model.DebugUsage'
1616
resultMap='get-debug-usage-result'>
1717
SELECT ID,
1818
SERVER_ID,
@@ -66,7 +66,7 @@
6666
WHERE SERVER_ID = #{serverId}
6767
</update>
6868

69-
<delete id='deleteDebugUsageStatistics' parameterType='java.lang.String'>
69+
<delete id='deleteDebugUsageStatistics' parameterType='com.mirth.connect.model.DebugUsage'>
7070
DELETE FROM DEBUGGER_USAGE
7171
WHERE SERVER_ID = #{serverId}
7272
</delete>

‎server/dbconf/mysql/mysql-debugusage.xml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<result property='invocationCount' column='INVOCATION_COUNT'/>
1313
</resultMap>
1414
<select id='getDebugUsageStatistics'
15-
parameterType='java.lang.String'
15+
parameterType='com.mirth.connect.model.DebugUsage'
1616
resultMap='get-debug-usage-result'>
1717
SELECT ID,
1818
SERVER_ID,
@@ -66,7 +66,7 @@
6666
WHERE SERVER_ID = #{serverId}
6767
</update>
6868

69-
<delete id='deleteDebugUsageStatistics' parameterType='java.lang.String'>
69+
<delete id='deleteDebugUsageStatistics' parameterType='com.mirth.connect.model.DebugUsage'>
7070
DELETE FROM DEBUGGER_USAGE
7171
WHERE SERVER_ID = #{serverId}
7272
</delete>

‎server/dbconf/oracle/oracle-debugusage.xml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<result property='invocationCount' column='INVOCATION_COUNT'/>
1313
</resultMap>
1414
<select id='getDebugUsageStatistics'
15-
parameterType='java.lang.String'
15+
parameterType='com.mirth.connect.model.DebugUsage'
1616
resultMap='get-debug-usage-result'>
1717
SELECT ID,
1818
SERVER_ID,
@@ -66,7 +66,7 @@
6666
WHERE SERVER_ID = #{serverId}
6767
</update>
6868

69-
<delete id='deleteDebugUsageStatistics' parameterType='java.lang.String'>
69+
<delete id='deleteDebugUsageStatistics' parameterType='com.mirth.connect.model.DebugUsage'>
7070
DELETE FROM DEBUGGER_USAGE
7171
WHERE SERVER_ID = #{serverId}
7272
</delete>

‎server/dbconf/postgres/postgres-debugusage.xml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<result property='invocationCount' column='INVOCATION_COUNT'/>
1313
</resultMap>
1414
<select id='getDebugUsageStatistics'
15-
parameterType='java.lang.String'
15+
parameterType='com.mirth.connect.model.DebugUsage'
1616
resultMap='get-debug-usage-result'>
1717
SELECT ID,
1818
SERVER_ID,
@@ -66,7 +66,7 @@
6666
WHERE SERVER_ID = #{serverId}
6767
</update>
6868

69-
<delete id='deleteDebugUsageStatistics' parameterType='java.lang.String'>
69+
<delete id='deleteDebugUsageStatistics' parameterType='com.mirth.connect.model.DebugUsage'>
7070
DELETE FROM DEBUGGER_USAGE
7171
WHERE SERVER_ID = #{serverId}
7272
</delete>

‎server/dbconf/sqlserver/sqlserver-debugusage.xml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<result property='invocationCount' column='INVOCATION_COUNT'/>
1313
</resultMap>
1414
<select id='getDebugUsageStatistics'
15-
parameterType='java.lang.String'
15+
parameterType='com.mirth.connect.model.DebugUsage'
1616
resultMap='get-debug-usage-result'>
1717
SELECT ID,
1818
SERVER_ID,
@@ -66,7 +66,7 @@
6666
WHERE SERVER_ID = #{serverId}
6767
</update>
6868

69-
<delete id='deleteDebugUsageStatistics' parameterType='java.lang.String'>
69+
<delete id='deleteDebugUsageStatistics' parameterType='com.mirth.connect.model.DebugUsage'>
7070
DELETE FROM DEBUGGER_USAGE
7171
WHERE SERVER_ID = #{serverId}
7272
</delete>

0 commit comments

Comments
 (0)