ayushtkn commented on code in PR #4939:
URL: https://github.com/apache/polaris/pull/4939#discussion_r3575672425


##########
polaris-core/src/main/java/org/apache/polaris/core/persistence/PolarisMetaStoreManager.java:
##########
@@ -284,6 +284,30 @@ default BaseResult bootstrapPolarisService(@NonNull 
PolarisCallContext callCtx)
   @NonNull EntitiesResult updateEntitiesPropertiesIfNotChanged(
       @NonNull PolarisCallContext callCtx, @NonNull List<EntityWithPath> 
entities);
 
+  /**
+   * Commits a batch of entity creations and property updates within a single 
transaction.
+   *
+   * @param callCtx call context
+   * @param creates entities to create
+   * @param updates entities to update (compare-and-swap)
+   * @return result indicating success or failure
+   */
+  default @NonNull EntitiesResult commitTransactionBatch(
+      @NonNull PolarisCallContext callCtx,
+      @NonNull List<EntityWithPath> creates,
+      @NonNull List<EntityWithPath> updates) {
+    for (EntityWithPath create : creates) {
+      EntityResult result = createEntityIfNotExists(callCtx, 
create.catalogPath(), create.entity());

Review Comment:
   Thanx @dimas-b for the pointers.
   > but I do not see a JDBC impl. for it. 
   
   I didn't catch it, can you explain a bit which class are you referring to. 
There isn't a separate JDBC-specific `commitTransactionBatch` class — JDBC 
deployments use `AtomicOperationMetaStoreManager` (via 
`JdbcMetaStoreManagerFactory`), and I added 
`commitTransactionBatch(MetaStoreChangeSet)` there. It merges all `creates` and 
`updates` into a single `writeEntities` call; 
`JdbcBasePersistenceImpl.writeEntities` already wraps that in 
`DatasourceOperations.runWithinTransaction` (auto-commit off, single 
connection, commit or rollback). So one batch commit = one RDBMS transaction.
   
   Am I missing something here?



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