jaybird
jaybird copied to clipboard
Attempt to retrieve actual processId [JDBC225]
Submitted by: @mrotteveel
Is duplicated by JDBC334 Is related to JDBC118
Currently Jaybird uses a System property set by the user to determine the processid to send to the server. Extend that to use the following mechanisms (in order): 1) sun.java.launcher.pid, (only Available on Oracle/Sun Java) 2) ManagementFactory.getRuntimeMXBean().getName() (should provide the PID on most or all platforms) 3) If all else fails: fall back to the property
Modified by: @mrotteveel
Fix Version: Jaybird 2.3 [ 10440 ]
Modified by: @mrotteveel
assignee: Roman Rokytskyy [ rrokytskyy ] => Mark Rotteveel [ avalanche1979 ]
Modified by: @mrotteveel
Fix Version: Jaybird 3.1 [ 10441 ]
Fix Version: Jaybird 3.0 [ 10440 ] =>
Modified by: @mrotteveel
Fix Version: Jaybird 5 [ 10871 ]
Fix Version: Jaybird 4 [ 10441 ] =>
Requires Java 10 minimum to retrieve process id, because that version introduced RuntimeMXBean.getPid(), otherwise it has to be extracted from RuntimeMXBean.getName(), but there is no guarantee it actually contains the process id. This will need to wait until we no longer support Java 8.
A better way might actually be to use ProcessHandle.current().pid() as that avoids a dependency on the java.management module, see ProcessHandle