eric-maynard commented on code in PR #243:
URL: https://github.com/apache/polaris/pull/243#discussion_r1746647160


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

Review Comment:
   I like the idea of using `jakarta.persistence.EntityExistsException` but it 
seems like that dependency might not be there yet. I will try the latter 
approach.
   
   <img width="400" alt="Screenshot 2024-09-06 at 12 38 38 AM" 
src="https://github.com/user-attachments/assets/999b1ea1-f3ea-4cca-8a93-25a2c70ee1d0";>
   



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