postgresql-jdbc.git / summary / log / commit / refs
commit 11fc0fd91f35b5439e4cbe20171925226410e2ce
Author: Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
Date: Thu Mar 27 07:26:26 2025 +0000
fix: make PgConnection#abort compatible with Java 24
Previously, #abort was using SQLPermission("callAbort").checkGuard(this)
to test abort permission, however, Java 24 permanently removes Security Manager,
so checkGuard always throws an exception.
The fix is to verify if the security manager is installed before checking the permission.
Fixes https://github.com/pgjdbc/pgjdbc/issues/3581
pgjdbc/src/main/java/org/postgresql/jdbc/PgConnection.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pgjdbc/src/main/java/org/postgresql/jdbc/PgConnection.java b/pgjdbc/src/main/java/org/postgresql/jdbc/PgConnection.java
index 0a228fc9..afda9c88 100644
--- a/pgjdbc/src/main/java/org/postgresql/jdbc/PgConnection.java
+++ b/pgjdbc/src/main/java/org/postgresql/jdbc/PgConnection.java
@@ -1712,7 +1712,7 @@ public class PgConnection implements BaseConnection {
return;
}
- SQL_PERMISSION_ABORT.checkGuard(this);
+ checkPermission(SQL_PERMISSION_ABORT);
AbortCommand command = new AbortCommand();
executor.execute(command);
[parent: a03f84c6d613]