Tony CHEMIT pushed to branch develop-5.x at ultreiaio / ird-observe
Commits:
-
68463971
by Tony CHEMIT at 2017-06-13T11:17:01-04:00
2 changed files:
- application-swing/src/main/java/fr/ird/observe/application/swing/RunObserve.java
- entities/src/main/java/fr/ird/observe/ObserveTopiaConfiguration.java
Changes:
| ... | ... | @@ -21,11 +21,11 @@ |
| 21 | 21 |
*/
|
| 22 | 22 |
package fr.ird.observe.application.swing;
|
| 23 | 23 |
|
| 24 |
-import org.apache.commons.logging.Log;
|
|
| 25 |
-import org.apache.commons.logging.LogFactory;
|
|
| 26 |
- |
|
| 27 | 24 |
import java.util.Arrays;
|
| 28 | 25 |
import java.util.Date;
|
| 26 |
+import java.util.TimeZone;
|
|
| 27 |
+import org.apache.commons.logging.Log;
|
|
| 28 |
+import org.apache.commons.logging.LogFactory;
|
|
| 29 | 29 |
|
| 30 | 30 |
|
| 31 | 31 |
import static org.nuiton.i18n.I18n.n;
|
| ... | ... | @@ -52,6 +52,22 @@ public class RunObserve extends ObserveRunner { |
| 52 | 52 |
|
| 53 | 53 |
public static void main(String... args) {
|
| 54 | 54 |
|
| 55 |
+ String property = System.getProperty("user.timezone");
|
|
| 56 |
+ System.setProperty("user.timezone", "UTC");
|
|
| 57 |
+ TimeZone timeZone = TimeZone.getDefault();
|
|
| 58 |
+ TimeZone.setDefault(null);
|
|
| 59 |
+ |
|
| 60 |
+ try {
|
|
| 61 |
+ Class.forName("org.h2.Driver");
|
|
| 62 |
+ } catch (ClassNotFoundException e) {
|
|
| 63 |
+ e.printStackTrace();
|
|
| 64 |
+ } finally {
|
|
| 65 |
+ |
|
| 66 |
+ if (property != null) {
|
|
| 67 |
+ System.setProperty("user.timezone", property);
|
|
| 68 |
+ }
|
|
| 69 |
+ TimeZone.setDefault(timeZone);
|
|
| 70 |
+ }
|
|
| 55 | 71 |
log.info("ObServe client launch at " + new Date() + " args: " + Arrays.toString(args));
|
| 56 | 72 |
|
| 57 | 73 |
new RunObserve(args).launch();
|
| ... | ... | @@ -47,7 +47,7 @@ public class ObserveTopiaConfiguration extends BeanTopiaConfiguration { |
| 47 | 47 |
hibernateExtraConfiguration.put("hibernate.hikari.maximumPoolSize", "10");
|
| 48 | 48 |
hibernateExtraConfiguration.put("hibernate.hikari.autoCommit", "false");
|
| 49 | 49 |
hibernateExtraConfiguration.put("hibernate.hikari.registerMbeans", "true");
|
| 50 |
- hibernateExtraConfiguration.put("hibernate.jdbc.time_zone", "UTC");
|
|
| 50 |
+// hibernateExtraConfiguration.put("hibernate.jdbc.time_zone", "UTC");
|
|
| 51 | 51 |
|
| 52 | 52 |
// hibernateExtraConfiguration.put(HibernateAvailableSettings.CONNECTION_PROVIDER, "org.hibernate.c3p0.internal.C3P0ConnectionProvider");
|
| 53 | 53 |
// hibernateExtraConfiguration.put(HibernateAvailableSettings.C3P0_MAX_SIZE, "500");
|