diff --git a/pljava-api/src/main/java/org/postgresql/pljava/annotation/processing/DDRProcessor.java b/pljava-api/src/main/java/org/postgresql/pljava/annotation/processing/DDRProcessor.java index 465f5ddf4..262ec227d 100644 --- a/pljava-api/src/main/java/org/postgresql/pljava/annotation/processing/DDRProcessor.java +++ b/pljava-api/src/main/java/org/postgresql/pljava/annotation/processing/DDRProcessor.java @@ -173,7 +173,7 @@ public SourceVersion getSupportedSourceVersion() * Update latest_tested to be the latest Java release on which this * annotation processor has been tested without problems. */ - int latest_tested = 22; + int latest_tested = 23; int ordinal_9 = SourceVersion.RELEASE_9.ordinal(); int ordinal_latest = latest_tested - 9 + ordinal_9; diff --git a/pljava-so/src/main/c/Backend.c b/pljava-so/src/main/c/Backend.c index 30569c2e0..e4324babb 100644 --- a/pljava-so/src/main/c/Backend.c +++ b/pljava-so/src/main/c/Backend.c @@ -1942,7 +1942,7 @@ void Backend_warnJEP411(bool isCommit) "Those changes will come in releases after Java 17."), errhint( "For migration planning, this version of PL/Java can still " - "enforce policy in Java versions up to and including 22, " + "enforce policy in Java versions up to and including 23, " "and Java 17 and 21 are positioned as long-term support releases. " "For details on how PL/Java will adapt, please bookmark " "https://github.com/tada/pljava/wiki/JEP-411") diff --git a/pljava-so/src/main/c/InstallHelper.c b/pljava-so/src/main/c/InstallHelper.c index 2cb5a9cb3..488ee0a66 100644 --- a/pljava-so/src/main/c/InstallHelper.c +++ b/pljava-so/src/main/c/InstallHelper.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2023 Tada AB and other contributors, as listed below. + * Copyright (c) 2015-2024 Tada AB and other contributors, as listed below. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the The BSD 3-Clause License @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -43,6 +44,9 @@ #include "pljava/PgObject.h" #include "pljava/type/String.h" +#if PG_VERSION_NUM < 170000 +#define AmAutoVacuumWorkerProcess() IsAutoVacuumWorkerProcess() +#define AmBackgroundWorkerProcess() IsBackgroundWorker /* * As of 9.6.1, IsBackgroundWorker still does not * have PGDLLIMPORT, but MyBgworkerEntry != NULL can be used in MSVC instead. @@ -50,11 +54,11 @@ * One thing it's needed for is to avoid dereferencing MyProcPort in a * background worker, where it's not set. */ -#include #if defined(_MSC_VER) #include #define IsBackgroundWorker (MyBgworkerEntry != NULL) #endif +#endif /* PG_VERSION_NUM < 170000 */ /* * The name of the table the extension scripts will create to pass information @@ -90,7 +94,7 @@ bool pljavaViableXact() char *pljavaDbName() { - if ( IsAutoVacuumWorkerProcess() || IsBackgroundWorker ) + if ( AmAutoVacuumWorkerProcess() || AmBackgroundWorkerProcess() ) { char *shortlived; static char *longlived; @@ -110,7 +114,7 @@ char *pljavaDbName() static char *origUserName() { - if ( IsAutoVacuumWorkerProcess() || IsBackgroundWorker ) + if ( AmAutoVacuumWorkerProcess() || AmBackgroundWorkerProcess() ) { char *shortlived; static char *longlived; @@ -354,8 +358,8 @@ char *pljavaFnOidToLibPath(Oid fnOid, char **langName, bool *trusted) bool InstallHelper_shouldDeferInit() { - if ( IsBackgroundWorker || IsAutoVacuumWorkerProcess() ) - return true; + if ( AmAutoVacuumWorkerProcess() || AmBackgroundWorkerProcess() ) + return true; if ( ! IsBinaryUpgrade ) return false; diff --git a/pljava-so/src/main/c/PgSavepoint.c b/pljava-so/src/main/c/PgSavepoint.c index b387ac6ac..45fcca81e 100644 --- a/pljava-so/src/main/c/PgSavepoint.c +++ b/pljava-so/src/main/c/PgSavepoint.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004-2019 Tada AB and other contributors, as listed below. + * Copyright (c) 2004-2024 Tada AB and other contributors, as listed below. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the The BSD 3-Clause License @@ -187,7 +187,9 @@ Java_org_postgresql_pljava_internal_PgSavepoint__1rollback(JNIEnv* env, jclass c PG_TRY(); { unwind(RollbackAndReleaseCurrentSubTransaction, xid, nestLevel); +#if PG_VERSION_NUM < 100000 SPI_restore_connection(); +#endif } PG_CATCH(); { diff --git a/src/site/markdown/use/policy.md b/src/site/markdown/use/policy.md index 9d0e3f800..df423a293 100644 --- a/src/site/markdown/use/policy.md +++ b/src/site/markdown/use/policy.md @@ -373,7 +373,7 @@ release, so relying on it is not recommended. The developers of Java have elected to phase out important language features used by PL/Java to enforce policy. The changes will come in releases after Java 17. For migration planning, this version of PL/Java can still enable -policy enforcement in Java versions up to and including 22, and Java 17 and 21 +policy enforcement in Java versions up to and including 23, and Java 17 and 21 are positioned as long-term support releases. (There is a likelihood, increasing with later Java versions, even before policy stops being enforceable, that some internal privileged operations by Java itself, or other libraries,