← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5092: Fixed tupid late night error causing dhis to throw multiple sql exceptions on startup.

 

------------------------------------------------------------
revno: 5092
committer: Bob Jolliffe bobjolliffe@xxxxxxxxx
branch nick: dhis2
timestamp: Thu 2011-11-03 09:13:21 +0000
message:
  Fixed tupid late night error causing dhis to throw multiple sql exceptions on startup.
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	2011-11-03 01:02:13 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/IdentityPopulator.java	2011-11-03 09:13:21 +0000
@@ -77,13 +77,13 @@
     // -------------------------------------------------------------------------
     @Transactional
     @Override
-    public void execute()
+    public void execute() throws SQLException
     {
         StatementHolder holder = statementManager.getHolder();
 
         Statement dummyStatement = holder.getStatement();
 
-        Statement statement;
+        Statement statement = null;
 
         try
         {
@@ -126,15 +126,17 @@
                 } catch ( SQLException ex )
                 {
                     Logger.getLogger( IdentityPopulator.class.getName() ).log( Level.SEVERE, null, ex );
-                } finally
-                {
-                    statement.close();
                 }
             }
         } catch ( SQLException ex )
         {
             Logger.getLogger( IdentityPopulator.class.getName() ).log( Level.SEVERE, null, ex );
             return;
+        } finally
+        {
+            if (statement !=null) {
+                statement.close();
+            }
         }
 
     }