Related to issue 29675: Added log messages in case of error
authorCarlos Aristu <carlos.aristu@openbravo.com>
Wed, 24 Jun 2015 09:19:24 +0200
changeset 27143 11fe473f73e6
parent 27142 2bc46cd053d5
child 27144 051a7473f534
child 27146 cf8c31083813
Related to issue 29675: Added log messages in case of error
modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelApplicationInitializer.java
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelApplicationInitializer.java	Wed Jun 24 00:55:16 2015 +0000
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelApplicationInitializer.java	Wed Jun 24 09:19:24 2015 +0200
@@ -68,19 +68,24 @@
         if (difference > THRESHOLD) {
           log4j.warn("Tomcat and Database are in different timezones.");
         }
+      } else {
+        log4j
+            .error("Received null as Database time. Not possible to check timezone differences with Tomcat.");
       }
     } catch (Exception ex) {
+      log4j.error("Could not check if Tomcat and Database are in different timezones.");
     }
   }
 
   private Date getDatabaseDateTime() {
     Date date = null;
     try {
-      // We retrieve the time from the database, without considering the time zone information
+      // We retrieve the time from the database, using the predefined sql date-time format
       String now = DateTimeData.now(new DalConnectionProvider(), sqlDateTimeFormat);
       SimpleDateFormat formatter = new SimpleDateFormat(javaDateTimeFormat);
       date = formatter.parse(now);
     } catch (Exception ex) {
+      log4j.error("Could not get the Database time.");
     }
     return date;
   }