details:   https://code.openbravo.com/erp/devel/pi/rev/57d3ba1c7f89
changeset: 13759:57d3ba1c7f89
user:      Antonio Moreno <antonio.moreno <at> openbravo.com>
date:      Mon Sep 12 15:55:50 2011 +0200
summary:   Related to issue 17641. Minor cleanup.

diffstat:

 src/org/openbravo/service/system/SystemService.java |  21 ++++++++-------------
 1 files changed, 8 insertions(+), 13 deletions(-)

diffs (66 lines):

diff -r 955c465f92e3 -r 57d3ba1c7f89 
src/org/openbravo/service/system/SystemService.java
--- a/src/org/openbravo/service/system/SystemService.java       Mon Sep 12 
13:42:24 2011 +0200
+++ b/src/org/openbravo/service/system/SystemService.java       Mon Sep 12 
15:55:50 2011 +0200
@@ -67,7 +67,7 @@
  */
 public class SystemService implements OBSingleton {
   private static SystemService instance;
-  protected Logger log4j = Logger.getLogger(this.getClass());
+  private static final Logger log4j = Logger.getLogger(SystemService.class);
 
   public static synchronized SystemService getInstance() {
     if (instance == null) {
@@ -307,8 +307,7 @@
             && OBScheduler.getInstance().getScheduler().isStarted())
           OBScheduler.getInstance().getScheduler().standby();
       } catch (Exception e) {
-        log4j.warn("Could not shutdown scheduler", e);
-        // We will not log an exception if the scheduler complains. The user 
shouldn't notice this
+        throw new RuntimeException("Could not shutdown scheduler", e);
       }
       OBDal.getInstance().getConnection().commit();
       disableConstraints(platform);
@@ -322,13 +321,8 @@
       List<Entity> entities = ModelProvider.getInstance().getModel();
       for (Entity entity : entities) {
         if ((entity.isClientEnabled() || entity.getName().equals("ADClient")) 
&& !entity.isView()) {
-          try {
-            final String sql;
-            sql = "delete from " + entity.getTableName() + " where 
ad_client_id=?";
-            sqlCommands.add(sql);
-          } catch (Exception e) {
-            e.printStackTrace();
-          }
+          final String sql = "delete from " + entity.getTableName() + " where 
ad_client_id=?";
+          sqlCommands.add(sql);
         }
       }
       for (String command : sqlCommands) {
@@ -353,7 +347,8 @@
       } finally {
         platform.returnConnection(con2);
       }
-      log4j.info("Delete client took " + (System.currentTimeMillis() - t1) + " 
miliseconds");
+      log4j.info("Deletion of client " + clientId + " took " + 
(System.currentTimeMillis() - t1)
+          + " miliseconds");
     } catch (Exception e) {
       log4j.error("exception when deleting the client: ", e);
     } finally {
@@ -376,7 +371,7 @@
           .prepareStatement("UPDATE AD_SYSTEM_INFO SET SYSTEM_STATUS='RB70'");
       ps2.executeUpdate();
     } catch (Exception e) {
-      log4j.error("Couldn't reset the safe mode", e);
+      throw new RuntimeException("Couldn't reset the safe mode", e);
     }
   }
 
@@ -390,7 +385,7 @@
           .prepareStatement("UPDATE AD_SYSTEM_INFO SET SYSTEM_STATUS='RB80'");
       ps2.executeUpdate();
     } catch (Exception e) {
-      log4j.error("Couldn't destroy concurrent sessions", e);
+      throw new RuntimeException("Couldn't destroy concurrent sessions", e);
     }
   }
 

------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop 
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to