vigneshio opened a new pull request, #4810:
URL: https://github.com/apache/polaris/pull/4810

   ## Why this change is needed
   This is a direct follow-up to #4795.
   
   In the main PR we fixed the *insert* (and update) path to use the 
`connection` passed from `runWithinTransaction`. However, the initial SELECT 
check inside `handleInheritablePolicy` (`loadPoliciesOnTargetByType`) was still 
going through the normal `callCtx` path and therefore used a separate 
connection.
   
   This follow-up makes the entire check-then-write for inheritable policies 
run on the same transaction.
   
   ## What changed
   - Added connection-aware `executeSelect(...)` and 
`executeSelectOverStream(...)` overloads in `DatasourceOperations`.
   - Added a private `fetchPolicyMappingRecords(PreparedQuery, Connection)` + a 
connection-aware overload of `loadPoliciesOnTargetByType`.
   - Updated the call inside `handleInheritablePolicy` to pass the transaction 
`connection`.
   
   This change only affects the JDBC backend when the write happens inside a 
`runWithinTransaction` callback.
   
   ## Checklist
   - [ ]  Don't disclose security issues! (contact [email protected])
   - [x] Clearly explained why the changes are needed, or linked related 
issues: Follow-up to #4795
   - [x] 🧪 Added/updated tests with good coverage, or manually tested (and 
explained how) — existing higher-level policy coverage + manual verification 
(same approach as #4795)
   - [x] Added comments for complex logic
   - [ ] 🧾 Updated `CHANGELOG.md` (if needed)
   - [ ] Updated documentation in `site/content/in-dev/unreleased` (if needed)


-- 
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]

Reply via email to