dennishuo commented on code in PR #243:
URL: https://github.com/apache/polaris/pull/243#discussion_r1776342307


##########
extension/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkMetaStoreSessionImpl.java:
##########
@@ -257,6 +260,12 @@ public <T> T runInTransaction(
       } finally {
         localSession.remove();
       }
+    } catch (PersistenceException e) {
+      if (e.toString().toLowerCase(Locale.ROOT).contains("duplicate key")) {
+        throw new AlreadyExistsException(e, "Duplicate key error when 
persisting entity");

Review Comment:
   Oh I see, didn't realize we hadn't already pulled in 
`jakarta.persistence-api`. Looks like we do pull it in as a `compileOnly` 
dependency in `polaris-core` and `polaris-service` already depends on 
`polaris-core` so it's kind of close.
   
   Looking at the package it seems like the exceptions are indeed in 
`jakarta.persistence-api` so in theory it just makes the fatjar bigger if we do 
fully add it as a dependency in `polaris-service` (latest jar appears to just 
be ~200kB, so it's not *too* bad).
   
   I guess I could go either way in this case.



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