singhpk234 commented on code in PR #3334:
URL: https://github.com/apache/polaris/pull/3334#discussion_r2656026992
##########
persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/JdbcBasePersistenceImpl.java:
##########
@@ -189,21 +203,10 @@ private void persistEntity(
realmId));
} catch (SQLException e) {
if (datasourceOperations.isConstraintViolation(e)) {
- PolarisBaseEntity existingEntity =
- lookupEntityByName(
- callCtx,
- entity.getCatalogId(),
- entity.getParentId(),
- entity.getTypeCode(),
- entity.getName());
- // This happens in two scenarios:
- // 1. PRIMARY KEY violated
- // 2. UNIQUE CONSTRAINT on (realm_id, catalog_id, parent_id,
type_code, name) violated
- // With SERIALIZABLE isolation, the conflicting entity may _not_ be
visible and
- // existingEntity can be null, which would cause an NPE in
- // EntityAlreadyExistsException.message().
- throw new EntityAlreadyExistsException(
- existingEntity != null ? existingEntity : entity, e);
Review Comment:
precisely presently thats what we are doing in the current code, the
connection is a separate connection than the one used in the transaction in
cases of `writeEntities` or a completely different connection in `writeEntity`
i am also debating the same is it worth it, i will run benchmark for this 50:50
R/W to see how much we deviate from prev numbers as recorded here :
https://github.com/apache/polaris/pull/1517#issue-3037027635
--
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]