dimas-b commented on code in PR #1496:
URL: https://github.com/apache/polaris/pull/1496#discussion_r2067382671
##########
extension/persistence/relational-jdbc/src/main/java/org/apache/polaris/extension/persistence/relational/jdbc/JdbcBasePersistenceImpl.java:
##########
@@ -93,11 +93,7 @@ public void writeEntity(
boolean nameOrParentChanged,
PolarisBaseEntity originalEntity) {
try {
- datasourceOperations.runWithinTransaction(
- statement -> {
- persistEntity(callCtx, entity, originalEntity, statement);
- return true;
- });
+ persistEntity(callCtx, entity, originalEntity, datasourceOperations);
Review Comment:
Conceptually, AFAIK, individual statements with auto commit are not
different from multi-statement transactions. If we observer concurrency issues
with the latter, I'd guess the same class of issues exist with the former, but
it may be harder to observer due to faster execution.
##########
extension/persistence/relational-jdbc/src/main/java/org/apache/polaris/extension/persistence/relational/jdbc/JdbcBasePersistenceImpl.java:
##########
@@ -189,6 +185,18 @@ private void persistEntity(
}
}
+ private int execute(Object executor, String query) throws SQLException {
+ if (executor instanceof Statement) {
+ // used for running in transaction
+ return ((Statement) executor).executeUpdate(query);
+ } else if (executor instanceof DatasourceOperations) {
+ // used for atomic queries
Review Comment:
The term "atomic" is misleading in this context. It usually means "all or
nothing" but in that sense it applies to any PostgreSQL DML committed via JDBC.
--
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]