Return-Path: X-Original-To: apmail-ambari-dev-archive@www.apache.org Delivered-To: apmail-ambari-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2F1521846F for ; Tue, 16 Jun 2015 19:28:41 +0000 (UTC) Received: (qmail 55525 invoked by uid 500); 16 Jun 2015 19:28:40 -0000 Delivered-To: apmail-ambari-dev-archive@ambari.apache.org Received: (qmail 55507 invoked by uid 500); 16 Jun 2015 19:28:40 -0000 Mailing-List: contact dev-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ambari.apache.org Delivered-To: mailing list dev@ambari.apache.org Received: (qmail 54709 invoked by uid 99); 16 Jun 2015 19:28:40 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Jun 2015 19:28:40 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id C00C51DFBE2; Tue, 16 Jun 2015 19:28:39 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============6358255603438444355==" MIME-Version: 1.0 Subject: Re: Review Request 35528: Views : DataStore persistence error From: "Nate Cole" To: "Nate Cole" , "Jonathan Hurley" Cc: "Ambari" , "Tom Beerbower" Date: Tue, 16 Jun 2015 19:28:39 -0000 Message-ID: <20150616192839.1515.34281@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: "Nate Cole" X-ReviewGroup: Ambari X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/35528/ X-Sender: "Nate Cole" References: <20150616192636.1512.61938@reviews.apache.org> In-Reply-To: <20150616192636.1512.61938@reviews.apache.org> Reply-To: "Nate Cole" X-ReviewRequest-Repository: ambari --===============6358255603438444355== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > On June 16, 2015, 3:26 p.m., Nate Cole wrote: > > The code looks like it caps the length of a value (ok), but where is the definition of that storage - in a db script somewhere? No sql changes to support the bigger field? I thought this might be "viewinstancedata" but I'm not sure. Oh, I see you said it's a dynamic entity - I thought there was a definition somewhere. You can ignore :) Just Jonathan's suggestions and I'm good. - Nate ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/35528/#review88110 ----------------------------------------------------------- On June 16, 2015, 2:31 p.m., Tom Beerbower wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/35528/ > ----------------------------------------------------------- > > (Updated June 16, 2015, 2:31 p.m.) > > > Review request for Ambari, Jonathan Hurley and Nate Cole. > > > Bugs: AMBARI-11957 > https://issues.apache.org/jira/browse/AMBARI-11957 > > > Repository: ambari > > > Description > ------- > > In one case we are seeing this exception while trying to store data from a view ... > > java.lang.IllegalStateException: > Exception Description: No transaction is currently active > at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.rollback(EntityTransactionImpl.java:176) > at org.apache.ambari.server.view.persistence.DataStoreImpl.store(DataStoreImpl.java:135) > at org.apache.ambari.view.hive.persistence.DataStoreStorage.store(DataStoreStorage.java:76) > at org.apache.ambari.view.hive.resources.CRUDResourceManager.save(CRUDResourceManager.java:117) > at > > The underlying exception ... > > Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException > Internal Exception: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(255) > Error Code: 0 > Call: UPDATE DS_JOBIMPL_4 SET DS_applicationId = ?, DS_duration = ?, DS_sqlState = ?, DS_status = ?, DS_statusMessage = ? WHERE (DS_id = ?) > bind => [6 parameters bound] > > > This occurs because the view tries to save an entity with a String type attribute which is mapped to a VARCHAR(255). The dynamic entity code maps the String to a VARCHAR using the database default length. > > Also, once the exception is thrown, the DataStore catches it and tries to rollback the transaction. It looks like the tx is already inactive at this point so a different exception is thrown out. The original exception should at least be logged by the DataStoreImpl. > > > Diffs > ----- > > ambari-server/src/main/java/org/apache/ambari/server/view/persistence/DataStoreImpl.java 8353d63 > ambari-server/src/test/java/org/apache/ambari/server/view/persistence/DataStoreImplTest.java 2b19b0a > > Diff: https://reviews.apache.org/r/35528/diff/ > > > Testing > ------- > > Manual tested. > > New unit tests added. > > mvn clean test > > all pass > > [INFO] ------------------------------------------------------------------------ > [INFO] BUILD SUCCESS > [INFO] ------------------------------------------------------------------------ > [INFO] Total time: 46:25 min > [INFO] Finished at: 2015-06-16T13:42:50-04:00 > [INFO] Final Memory: 54M/1453M > [INFO] ------------------------------------------------------------------------ > > > Thanks, > > Tom Beerbower > > --===============6358255603438444355==--