Hi,
Yes, I understand the value of Spring's exception translation facilities. I'm wondering more about implementation details. Since OpenJPA already translates 100% of the exceptions thrown (including exceptions thrown from within lazy loading and such from direct access of persistent data in a managed instance), it would seem that we could do a more optimal integration between Spring and OpenJPA, such that OpenJPA translated exceptions directly from OpenJPA-internal types to Spring types, instead of the current OpenJPA-internal => JPA spec + extensions => Spring types.
Does that make sense?
-Patrick
Yes, we could translate any OpenJPA specific exceptions in the OpenJpaDialect class. That would definitely be valuable.Yes, I understand the value of Spring's exception translation facilities. I'm wondering more about implementation details. Since OpenJPA already translates 100% of the exceptions thrown (including exceptions thrown from within lazy loading and such from direct access of persistent data in a managed instance), it would seem that we could do a more optimal integration between Spring and OpenJPA, such that OpenJPA translated exceptions directly from OpenJPA-internal types to Spring types, instead of the current OpenJPA-internal => JPA spec + extensions => Spring types.
That would work with the above scenario and we could translate that directly into a DataIntegrityViolationException.If OpenJPA were throwing an org.apache.openjpa.persistence.ReferentialIntegrit yException instead of just a PersistenceException, would that change things?