dimas-b commented on code in PR #3352:
URL: https://github.com/apache/polaris/pull/3352#discussion_r2662609062


##########
persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/JdbcBasePersistenceImpl.java:
##########
@@ -137,6 +139,14 @@ public void writeEntities(
       @Nonnull PolarisCallContext callCtx,
       @Nonnull List<PolarisBaseEntity> entities,
       List<PolarisBaseEntity> originalEntities) {
+    Set<Long> seenEntityIds = new HashSet<>();
+    for (PolarisBaseEntity entity : entities) {
+      if (!seenEntityIds.add(entity.getId())) {
+        throw new RetryOnConcurrencyException(
+            "Multiple updates to entity id '%s' in the same transaction", 
entity.getId());
+      }
+    }

Review Comment:
   Interesting ... :thinking: 
   
   Are you saying that our impl. of `commitTransaction()` will cause multiple 
`PolarisBaseEntity` to be written via the Persistence interface, while some of 
those objects share the same ID?



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