Skip to content

Commit

Permalink
Add an explicit timezone to the database connection (fix #489)
Browse files Browse the repository at this point in the history
  • Loading branch information
arteymix committed Nov 25, 2022
1 parent e278bf4 commit 963b42b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions gemma-core/src/main/resources/default.properties
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ gemma.db.maxpoolidle=5
gemma.db.maxtotal=75
# This ensure some basic behaviors of our database
gemma.db.sqlMode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
# Default timezone for storage of DATETIME that are mapped to exact moments (i.e. java.util.Date)
gemma.db.timezone=America/Vancouver
############################################################
# SECURITY
# Used to elevate authorities for some methods.
Expand Down
2 changes: 1 addition & 1 deletion gemma-core/src/main/resources/ubic/gemma/dataSource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<property name="maxWaitMillis" value="100000"/>
<property name="testOnBorrow" value="true"/>
<property name="validationQuery" value="SELECT 1"/>
<property name="connectionProperties" value="sessionVariables=sql_mode='${gemma.db.sqlMode}'"/>
<property name="connectionProperties" value="connectionTimeZone=${gemma.db.timezone};sessionVariables=sql_mode='${gemma.db.sqlMode}'"/>
</bean>


Expand Down

0 comments on commit 963b42b

Please sign in to comment.