You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@polaris.apache.org by di...@apache.org on 2026/06/17 13:14:23 UTC

(polaris) branch main updated: Fix inheritable policy mapping insert to use transaction connection (#4795)

This is an automated email from the ASF dual-hosted git repository.

dimas-b pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris.git


The following commit(s) were added to refs/heads/main by this push:
     new 04d391180a Fix inheritable policy mapping insert to use transaction connection (#4795)
04d391180a is described below

commit 04d391180aeb3ece418a07750a488000029b6347
Author: vignesh_A <16...@users.noreply.github.com>
AuthorDate: Wed Jun 17 18:44:18 2026 +0530

    Fix inheritable policy mapping insert to use transaction connection (#4795)
    
    * Fix inheritable policy mapping insert transaction issue
    
    The insert operation was using a separate connection and was getting
    committed automatically. Updated it to use the transaction connection
    so it runs within the same runWithinTransaction block.
    
    * Add CHANGELOG entry for JDBC inheritable policy mapping tx fix
---
 CHANGELOG.md                                                            | 1 +
 .../polaris/persistence/relational/jdbc/JdbcBasePersistenceImpl.java    | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index abec65ffcb..e45c036ce7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -65,6 +65,7 @@ request adding CHANGELOG notes for breaking (!) changes and possibly other secti
 - The admin tool `purge` command now prints the underlying exception stack trace to stderr when a purge fails unexpectedly, matching the `bootstrap` command. Previously a failed purge printed only a generic message, giving operators no diagnostic information.
 - The access token carried in `PolarisCredential` is now redacted from its `toString()`, so it is no longer written to authentication logs (including at WARN level on failed authentication).
 - JWT verification now validates the issuer claim (`"polaris"`) in addition to the active claim. Tokens signed with the same key but carrying a different issuer are now rejected.
+- Inheritable policy mapping inserts in the JDBC backend now use the active transaction connection, so they roll back correctly with the surrounding transaction.
 
 ## [1.5.0]
 
diff --git a/persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/JdbcBasePersistenceImpl.java b/persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/JdbcBasePersistenceImpl.java
index 112ee7a9a8..b9bcc45141 100644
--- a/persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/JdbcBasePersistenceImpl.java
+++ b/persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/JdbcBasePersistenceImpl.java
@@ -1125,7 +1125,7 @@ public class JdbcBasePersistenceImpl
       datasourceOperations.execute(connection, updateQuery);
     } else {
       // record doesn't exist do an insert.
-      datasourceOperations.executeUpdate(insertQuery);
+      datasourceOperations.execute(connection, insertQuery);
     }
     return true;
   }