← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13145: Identity populator, cathing all exceptions instead of bad sql grammar exception

 

------------------------------------------------------------
revno: 13145
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-12-04 16:23:25 +0100
message:
  Identity populator, cathing all exceptions instead of bad sql grammar exception
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/IdentityPopulator.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/IdentityPopulator.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/IdentityPopulator.java	2013-09-19 12:43:34 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/IdentityPopulator.java	2013-12-04 15:23:25 +0000
@@ -137,11 +137,9 @@
                     log.info( count + " timestamps set on " + table );
                 }
             }
-            catch ( Exception ex )
+            catch ( Exception ex ) // Log and continue
             {
                 log.error( "Problem updating: " + table + ", id column: " + getIdColumn( table ), ex );
-
-                throw ex;
             }
         }
 
@@ -170,7 +168,7 @@
                 final String sql = "ALTER TABLE " + table + " ADD CONSTRAINT " + table + "_uid_key UNIQUE(uid)";
                 jdbcTemplate.execute( sql );
             }
-            catch ( BadSqlGrammarException ex )
+            catch ( Exception ex ) // Log and continue, will fail after first run
             {
                 log.debug( "Could not create uid constraint on table " + table +
                     ", might already be created or column contains duplicates", ex );
@@ -198,9 +196,9 @@
                 log.info( count + " UUIDs updated on organisationunit" );
             }
         }
-        catch ( BadSqlGrammarException ex )
+        catch ( Exception ex ) // Log and continue
         {
-            log.debug( "Problem updating organisationunit: ", ex );
+            log.error( "Problem updating organisationunit: ", ex );
         }
     }
 }