How do I catch the constraint violation exception from EclipseLink?

后端 未结 6 2377
-上瘾入骨i
-上瘾入骨i 2021-02-19 06:54

I am using EclipseLink in my web application, and I am having a hard time gracefully catching and handling Exceptions it generates. I see from this thread what seems to be a si

6条回答
  •  [愿得一人]
    2021-02-19 07:06

    EclipseLink should only be throwing either a PersitenceException or a RollbackException depending on the environment and the order of operations you are calling on the EntityManager. What is your logging level? It is likely that you are seeing these exceptions logged by EclipseLink but only thrown as causes of the RollbackException.

    You can turn off exception logging with the PU property but for diagnostic purposes it is generally better to allow EclipseLink to log the exceptions.

提交回复
热议问题