[libpostgresql-jdbc-java] 07/128: Expose PID of the backend process serving a paricular JDBC connection through a new method in PGConnection interface, analogous to PQbackendPID in libpq C API.
Emmanuel Bourg
ebourg-guest at moszumanska.debian.org
Mon Jan 9 10:18:25 UTC 2017
This is an automated email from the git hooks/post-receive script.
ebourg-guest pushed a commit to annotated tag REL9_3_1100
in repository libpostgresql-jdbc-java.
commit 288de0a697787a1549f2358cc348ee89e74e01ee
Author: Rafał Krzewski <rafal.krzewski at caltha.pl>
Date: Thu Oct 25 19:34:35 2012 +0200
Expose PID of the backend process serving a paricular JDBC connection through
a new method in PGConnection interface, analogous to PQbackendPID in libpq C API.
---
org/postgresql/PGConnection.java | 6 ++++++
org/postgresql/core/ProtocolConnection.java | 5 +++++
org/postgresql/core/v2/ProtocolConnectionImpl.java | 5 +++++
org/postgresql/core/v3/ProtocolConnectionImpl.java | 5 +++++
org/postgresql/jdbc2/AbstractJdbc2Connection.java | 5 +++++
5 files changed, 26 insertions(+)
diff --git a/org/postgresql/PGConnection.java b/org/postgresql/PGConnection.java
index 6e98361..6d61f43 100644
--- a/org/postgresql/PGConnection.java
+++ b/org/postgresql/PGConnection.java
@@ -110,5 +110,11 @@ public interface PGConnection
*/
public int getPrepareThreshold();
+ /**
+ * Return the process ID (PID) of the backend server process handling this connection.
+ *
+ * @return PID of backned server process.
+ */
+ public int getBackendPID();
}
diff --git a/org/postgresql/core/ProtocolConnection.java b/org/postgresql/core/ProtocolConnection.java
index 153c277..71f962f 100644
--- a/org/postgresql/core/ProtocolConnection.java
+++ b/org/postgresql/core/ProtocolConnection.java
@@ -143,4 +143,9 @@ public interface ProtocolConnection {
* @return the server integer_datetime setting.
*/
public boolean getIntegerDateTimes();
+
+ /**
+ * Return the process ID (PID) of the backend server process handling this connection.
+ */
+ public int getBackendPID();
}
diff --git a/org/postgresql/core/v2/ProtocolConnectionImpl.java b/org/postgresql/core/v2/ProtocolConnectionImpl.java
index 567ad3e..5b4119a 100644
--- a/org/postgresql/core/v2/ProtocolConnectionImpl.java
+++ b/org/postgresql/core/v2/ProtocolConnectionImpl.java
@@ -207,6 +207,11 @@ class ProtocolConnectionImpl implements ProtocolConnection {
return false;
}
+ public int getBackendPID()
+ {
+ return cancelPid;
+ }
+
private String serverVersion;
private int cancelPid;
private int cancelKey;
diff --git a/org/postgresql/core/v3/ProtocolConnectionImpl.java b/org/postgresql/core/v3/ProtocolConnectionImpl.java
index 94214b4..d7b0136 100644
--- a/org/postgresql/core/v3/ProtocolConnectionImpl.java
+++ b/org/postgresql/core/v3/ProtocolConnectionImpl.java
@@ -198,6 +198,11 @@ class ProtocolConnectionImpl implements ProtocolConnection {
{
return 3;
}
+
+ public int getBackendPID()
+ {
+ return cancelPid;
+ }
public boolean useBinaryForReceive(int oid) {
return useBinaryForOids.contains(oid);
diff --git a/org/postgresql/jdbc2/AbstractJdbc2Connection.java b/org/postgresql/jdbc2/AbstractJdbc2Connection.java
index d5e38c1..3d7f564 100644
--- a/org/postgresql/jdbc2/AbstractJdbc2Connection.java
+++ b/org/postgresql/jdbc2/AbstractJdbc2Connection.java
@@ -1227,4 +1227,9 @@ public abstract class AbstractJdbc2Connection implements BaseConnection
public boolean binaryTransferSend(int oid) {
return useBinarySendForOids.contains(oid);
}
+
+ public int getBackendPID()
+ {
+ return protoConnection.getBackendPID();
+ }
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/libpostgresql-jdbc-java.git
More information about the pkg-java-commits
mailing list