Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-6019

Views : JPA Exception installing view

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.6.1
    • None
    • None

    Description

      Get the following exception if views are deployed, then restart with new view in views folder. The new view fails to deploy with the following ...

      javax.persistence.RollbackException: Exception EclipseLink-7251 (Eclipse Persistence Services - 2.4.0.v20120608-): org.eclipse.persistence.exceptions.ValidationException
      Exception Description: The attribute view of class org.apache.ambari.server.orm.entities.ViewInstanceEntity is mapped to a primary key column in the database. Updates are not allowed.

      The exception only happens if a new instance of one of the initial views is created through the REST API before the server is restarted and the new view deployed.

      It turns out that there is an issue when the views are being setup in the registry. Any instance that is not present in the archive but exists in the Ambari db is bound to the registry view and added to the registry. The problem is that the instance being added to the registry is still bound to the entity manager. Since the registry view is a different instance of a ViewEntity, JPA complains because you can't change the PK of the instance.

      The strange part is that the exception is not reported right away. Instead it get thrown on the commit from the AmbariJpaLocalTxnInterceptor when a totally different view is being created in the db.

      Attachments

        Issue Links

          Activity

            People

              tbeerbower Tom Beerbower
              tbeerbower Tom Beerbower
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: