----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/34813/ -----------------------------------------------------------
Review request for Ambari and John Speidel. Bugs: AMBARI-11540 https://issues.apache.org/jira/browse/AMBARI-11540 Repository: ambari Description ------- Intermittent BatchUpdateException during create instance of HIVE view. Refactored @Transactional method ViewRegistry.installViewInstance() to remove instanceDAO.findByName() which appears to trigger EntityManagerImpl.flush(). Internal Exception: java.sql.BatchUpdateException: Batch entry 0 INSERT INTO viewinstanceproperty (name, VALUE, view_name, view_instance_name) VALUES ('views.tez.instance', NULL, 'HIVE{0.4.0}', 'hiwe2') was aborted. Call getNextException to see the cause. Error Code: 0 Call: INSERT INTO viewinstanceproperty (name, VALUE, view_name, view_instance_name) VALUES (?, ?, ?, ?) bind => [4 parameters bound] at org.eclipse.persistence.internal.jpa.EntityManagerImpl.flush(EntityManagerImpl.java:868) at org.eclipse.persistence.internal.jpa.QueryImpl.performPreQueryFlush(QueryImpl.java:963) at org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery(QueryImpl.java:207) at org.eclipse.persistence.internal.jpa.QueryImpl.getSingleResult(QueryImpl.java:517) at org.eclipse.persistence.internal.jpa.EJBQueryImpl.getSingleResult(EJBQueryImpl.java:400) at org.apache.ambari.server.orm.dao.DaoUtils.selectSingle(DaoUtils.java:71) at org.apache.ambari.server.orm.dao.ViewInstanceDAO.findByName(ViewInstanceDAO.java:62) at org.apache.ambari.server.orm.AmbariLocalSessionInterceptor.invoke(AmbariLocalSessionInterceptor.java:53) at org.apache.ambari.server.view.ViewRegistry.installViewInstance(ViewRegistry.java:528) Diffs ----- ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java b3ae2d0 ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java c66a9ce Diff: https://reviews.apache.org/r/34813/diff/ Testing ------- Manual testing to create view instances. Updated unit tests. mvn clean test all tests pass Thanks, Tom Beerbower