A Heisenbug can arise if more than one embedded Derby application runs in the same VM and at least one of them generates derby properties on the fly. Here's the problem scenario:
o The customer runs two embedded Derby apps in the same VM: EmbeddedApp and OtherApp.
o EmbeddedApp generates derby properties on the fly before connecting to a database and triggering engine startup.
o Whether the engine picks up those generated properties depends on whether EmbeddedApp or OtherApp runs first.
Here are two workarounds for the problem:
1) Don't generate derby properties on the fly. Instead, specify them on the VM startup command. Or specify them in a $DERBY_HOME/derby.properties file which is generated before the VM comes up and which does not change during the lifetime of the VM.
2) If you can't do (1), then modify the VM startup script so that the self-configuring EmbeddedApp runs first.