Results 1 to 2 of 2

Thread: Translating PersistenceException to DataAccessException with EclipseLinkJpaDialect

  1. #1

    Default Translating PersistenceException to DataAccessException with EclipseLinkJpaDialect

    Hallo all.
    I use EclipseLink as JPA vendor and I have a problem with the EclipseLinkJpaDialect.

    I notice that extends DefaultJpaDialect but not overrides the translateExceptionIfPossible method.

    So in my test case I have a unique constraint violation exception and debugging the control flow shows this stacktrace:

    Code:
    EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(RuntimeException) line: 282   
    EclipseLinkJpaDialect(DefaultJpaDialect).translateExceptionIfPossible(RuntimeException) line: 120   
    LocalContainerEntityManagerFactoryBean(AbstractEntityManagerFactoryBean).translateExceptionIfPossible(RuntimeException) line: 368   
    ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(RuntimeException) line: 58   
    DataAccessUtils.translateIfNecessary(RuntimeException, PersistenceExceptionTranslator) line: 213    
    PersistenceExceptionTranslationInterceptor.invoke(MethodInvocation) line: 163   
    ReflectiveMethodInvocation.proceed() line: 172
    The exception of the call is:

    Code:
    javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.2.v20101206-r8635): org.eclipse.persistence.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: [BEA][Oracle JDBC Driver][Oracle]ORA-00001: unique constraint (JSP_OWN.IDX_MC_CC_RAPPORTI_02) violated
    The final exception that is returned is the general JpaSystemException:

    Code:
    org.springframework.orm.jpa.JpaSystemException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.1.2.v20101206-r8635): org.eclipse.persistence.exceptions.DatabaseException
    Internal Exception: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: violata restrizione di unicità (CONT_OWN.PK_CONT_EVENT_MESSAGE)
    Any idea how to get the machine works for EclipseLink? Kind regards

    Massimo

  2. #2

    Default

    Noone can help me?

    Massimo

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •