Skip to content

Conversation

@NicoPiel
Copy link

@NicoPiel NicoPiel commented Nov 19, 2025

Solves #207

Copy link
Contributor

@mgaffigan mgaffigan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with changing:

  • server/src/com/mirth/connect/client/core/api/providers/CalendarParamConverterProvider.java
  • server/src/com/mirth/connect/plugins/serverlog/ServerLogItem.java

but the others are all allocated on the stack - and have no possibility for cross-thread use. Changing DateUtil in particular seems unnecessarily risky.

Also, is there a reason we're jumping to Apache FastDateFormat instead of Java 8 DateTimeFormatter?

@NicoPiel NicoPiel force-pushed the bug/replace-simpledateformat branch from 9b1257e to 614b02e Compare November 20, 2025 00:18
@NicoPiel NicoPiel changed the title Replaced SimpleDateFormat with FastDateFormat wherever possible Replaced SimpleDateFormat with DateTimeFormatter wherever thread-critical Nov 20, 2025
NicoPiel and others added 9 commits November 20, 2025 15:15
…es only

Signed-off-by: Nico Piel <nico.piel@hotmail.de>
Signed-off-by: Nico Piel <nico.piel@hotmail.de>
This script is the main launcher for the Open Integration Engine (OIE)
server. It prepares the Java environment and executes the server launcher
JAR file.

The script automatically finds a compatible Java runtime (version 17+ by
default) by searching for a valid executable in the following priority order:
  1. The OIE_JAVA_PATH environment variable.
  2. The -java-cmd directive in the oieserver.vmoptions file or included
     .vmoptions files. Must specify the path to the 'java' executable.
     This is the preferred way to declare the desired version for running
     the server and can be overridden by OIE_JAVA_PATH. Can be a relative
     path from the location of this script.
  3. The JAVA_HOME environment variable.
  4. The 'java' command available in the system's PATH.

It also parses the 'oieserver.vmoptions' file to configure JVM options,
system properties (-D...), and classpath modifications.

Signed-off-by: Tony Germano <tony@germano.name>
Co-authored-by: Mitch Gaffigan <mitch.gaffigan@comcast.net>
Issue: OpenIntegrationEngine#2
Signed-off-by: Nico Piel <nico.piel@hotmail.de>
This addresses an upsert race condition that occurred when saving plugin
properties (e.g., Data Pruner settings, third-party plugins) in
environments with a read/write split database configuration where the
read-only connection points to a replica.

The Problem:
The prior code attempted to determine whether to INSERT or
UPDATE by first checking for the property's existence using the
read-only database connection. Since updating all properties for a
plugin involves deleting them all first, if this DELETE operation had
not yet propagated to the replica, the read-only check would incorrectly
indicate the property still existed.

The Result:
An UPDATE statement would be attempted, which would fail to
match any rows (since the data had already been deleted from the
primary) and silently return zero rows updated. This failure was not
being checked, leading to data loss for the affected property.

The Solution:
This change eliminates the preliminary read check. It now
attempts an UPDATE first. If the update affects zero rows, a guaranteed
INSERT is performed. This pattern ensures atomicity and correctness
regardless of replication latency.

See https://sqlperformance.com/2020/09/locking/upsert-anti-pattern

Issue: Innovar-Healthcare/BridgeLink#66
Signed-off-by: Tony Germano <tony@germano.name>
Signed-off-by: Nico Piel <nico.piel@hotmail.de>
Signed-off-by: Mitch Gaffigan <mitch.gaffigan@comcast.net>
Signed-off-by: Nico Piel <nico.piel@hotmail.de>
Signed-off-by: Mitch Gaffigan <mitch.gaffigan@comcast.net>
Signed-off-by: Nico Piel <nico.piel@hotmail.de>
Many of the extensions do not include external dependencies, but for
consistency in the build file all extensions attempt to copy libs if
they exist. The copy tasks were already to configured to not fail if
there was an error copying the files (because the source dir does not
exist in this case.) This change also sets the quiet option so that a
warning is not produced in the build output on a copy error.

Signed-off-by: Tony Germano <tony@germano.name>
Signed-off-by: Nico Piel <nico.piel@hotmail.de>
Signed-off-by: Tony Germano <tony@germano.name>
Signed-off-by: Nico Piel <nico.piel@hotmail.de>
@NicoPiel NicoPiel force-pushed the bug/replace-simpledateformat branch from 2ce92e1 to 75644de Compare November 20, 2025 14:15
@jonbartels
Copy link
Contributor

I agree with Mitch

Also, is there a reason we're jumping to Apache FastDateFormat instead of Java 8 DateTimeFormatter?

The core Java DateTimeFormatter is rock solid.

@NicoPiel
Copy link
Author

I agree with Mitch

Also, is there a reason we're jumping to Apache FastDateFormat instead of Java 8 DateTimeFormatter?

The core Java DateTimeFormatter is rock solid.

That's why it's implemented :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants