Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to retrieve actual processId [JDBC225] #274

Closed
firebird-automations opened this issue Jan 5, 2012 · 8 comments
Closed

Attempt to retrieve actual processId [JDBC225] #274

firebird-automations opened this issue Jan 5, 2012 · 8 comments

Comments

@firebird-automations
Copy link

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
Copy link
Author

Modified by: @mrotteveel

Fix Version: Jaybird 2.3 [ 10440 ]

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

Link: This issue is duplicated by JDBC334 [ JDBC334 ]

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

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

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

Link: This issue is related to JDBC118 [ JDBC118 ]

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

Fix Version: Jaybird 3.1 [ 10441 ]

Fix Version: Jaybird 3.0 [ 10440 ] =>

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

Fix Version: Jaybird 5 [ 10871 ]

Fix Version: Jaybird 4 [ 10441 ] =>

@mrotteveel
Copy link
Member

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
Copy link
Member

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

mrotteveel added a commit to FirebirdSQL/jaybird-manual that referenced this issue Jan 21, 2023
@mrotteveel mrotteveel added this to the v6-initial milestone Jun 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants