jaybird icon indicating copy to clipboard operation
jaybird copied to clipboard

Attempt to retrieve actual processId [JDBC225]

Open firebird-automations opened this issue 13 years ago • 7 comments

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

firebird-automations avatar Jan 05 '12 09:01 firebird-automations

Modified by: @mrotteveel

Fix Version: Jaybird 2.3 [ 10440 ]

firebird-automations avatar Jul 14 '12 18:07 firebird-automations

Modified by: @mrotteveel

Link: This issue is duplicated by JDBC334 [ JDBC334 ]

firebird-automations avatar Dec 16 '13 19:12 firebird-automations

Modified by: @mrotteveel

assignee: Roman Rokytskyy [ rrokytskyy ] => Mark Rotteveel [ avalanche1979 ]

firebird-automations avatar Dec 16 '13 19:12 firebird-automations

Modified by: @mrotteveel

Link: This issue is related to JDBC118 [ JDBC118 ]

firebird-automations avatar Dec 16 '13 19:12 firebird-automations

Modified by: @mrotteveel

Fix Version: Jaybird 3.1 [ 10441 ]

Fix Version: Jaybird 3.0 [ 10440 ] =>

firebird-automations avatar Mar 12 '16 20:03 firebird-automations

Modified by: @mrotteveel

Fix Version: Jaybird 5 [ 10871 ]

Fix Version: Jaybird 4 [ 10441 ] =>

firebird-automations avatar Jul 22 '18 13:07 firebird-automations

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.

mrotteveel avatar Sep 19 '22 14:09 mrotteveel

A better way might actually be to use ProcessHandle.current().pid() as that avoids a dependency on the java.management module, see ProcessHandle

mrotteveel avatar Jan 21 '23 15:01 mrotteveel