vigneshio commented on code in PR #4810:
URL: https://github.com/apache/polaris/pull/4810#discussion_r3459341611
##########
persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/JdbcBasePersistenceImpl.java:
##########
@@ -1231,6 +1235,45 @@ public List<PolarisPolicyMappingRecord>
loadPoliciesOnTargetByType(
ModelPolicyMappingRecord.ALL_COLUMNS,
ModelPolicyMappingRecord.TABLE_NAME, params));
}
+ /**
+ * Connection-aware version for use inside runWithinTransaction (for
inheritable policy check).
+ */
+ private List<PolarisPolicyMappingRecord> fetchPolicyMappingRecords(
+ QueryGenerator.PreparedQuery query, @NonNull Connection connection) {
+ try {
+ var results =
+ datasourceOperations.executeSelect(connection, query, new
ModelPolicyMappingRecord());
+ return results == null ? Collections.emptyList() : results;
+ } catch (SQLException e) {
+ throw new RuntimeException(
+ String.format("Failed to retrieve policy mapping records %s",
e.getMessage()), e);
+ }
+ }
+
+ /** Connection-aware overload for use inside transaction. */
+ @NonNull
+ public List<PolarisPolicyMappingRecord> loadPoliciesOnTargetByType(
Review Comment:
Good point... I made it package-private instead. Since the connection-aware
`loadPoliciesOnTargetByType(..., Connection)` is only used internally by
`handleInheritablePolicy`, it doesn't really need to be public..
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]