WST timezone issue

A Western Australian practice recently updated from Java 6 to Java 7, and started getting "Failed to execute query" errors, with an underlying cause like:

Caused by: com.thoughtworks.xstream.converters.ConversionException: Cannot parse date 2014-06-01 18:05:08.726 WST
---- Debugging information ----
-------------------------------
    at com.thoughtworks.xstream.converters.basic.DateConverter.fromString(DateConverter.java:97)
    at org.openvpms.component.business.domain.im.datatypes.basic.TypedValueConverter.fromString(TypedValueConverter.java:115)
    at org.openvpms.component.business.domain.im.datatypes.basic.TypedValue.getObject(TypedValue.java:141)
    at org.openvpms.component.business.domain.im.datatypes.basic.TypedValueMap$EntrySetIterator.next(TypedValueMap.java:401)
    at org.openvpms.component.business.domain.im.datatypes.basic.TypedValueMap$EntrySetIterator.next(TypedValueMap.java:374)
    at org.openvpms.component.business.dao.hibernate.im.common.MapConverter.convert(MapConverter.java:49)
    at org.openvpms.component.business.dao.hibernate.im.common.IMObjectAssembler.assembleObject(IMObjectAssembler.java:294)
    at org.openvpms.component.business.dao.hibernate.im.entity.EntityAssembler.assembleObject(EntityAssembler.java:115)
    at org.openvpms.component.business.dao.hibernate.im.party.PartyAssembler.assembleObject(PartyAssembler.java:77)
    at org.openvpms.component.business.dao.hibernate.im.party.PartyAssembler.assembleObject(PartyAssembler.java:36)
    at org.openvpms.component.business.dao.hibernate.im.common.IMObjectAssembler.assemble(IMObjectAssembler.java:178)
    at org.openvpms.component.business.dao.hibernate.im.common.CompoundAssembler.assemble(CompoundAssembler.java:118)
    at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate$8.doInHibernate(IMObjectDAOHibernate.java:846)
    at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate$8.doInHibernate(IMObjectDAOHibernate.java:835)
    at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406)
    at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:339)
    at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate.execute(IMObjectDAOHibernate.java:1115)
    at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate.get(IMObjectDAOHibernate.java:835)
    at org.openvpms.component.business.dao.hibernate.im.IMObjectDAOHibernate.get(IMObjectDAOHibernate.java:484)
    at org.openvpms.component.business.service.archetype.ArchetypeService.get(ArchetypeService.java:326)
    ... 81 more

The parse error is occurring because WST is no longer recognised as a valid timezone. It was replaced with AWST in version 1.4.6 of the timezone data, as documented here http://www.oracle.com/technetwork/java/javase/tzdata-versions-138805.html :

Australian eastern time zone abbreviations are now AEST/AEDT not EST, and similarly for the other Australian zones. That is, for eastern standard and daylight saving time the abbreviations are AEST and AEDT instead of the former EST for both; similarly, ACST/ACDT, ACWST/ACWDT, and AWST/AWDT are now used instead of the former CST, CWST, and WST. This change does not affect UTC offsets, only time zone abbreviations

The fix is to update both the entity_details and act_details to replace the WST timezone with AWST as follows:

1. back up your database

2. run the following in mysql:

update entity_details
set value=concat(substring(value, 1, length(value) -3), "AWST")
where type = "date" and value like "% WST";

update act_details
set value=concat(substring(value, 1, length(value) -3), "AWST")
where type = "date" and value like "% WST";

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: WST timezone issue

Tim - looking in one of my databases [admittedly migrated to 1.8], neither entity_details or act_details have records of type "date".  "sql-timestamp" - yes, but no "date".

I also looked through the migrate scripts and cannot see anything that changed type date to type sql-timestamp.

Regards, Tim G

 

 

Re: WST timezone issue

In 1.6 and earlier, date details nodes were stored as a "date" type, not an "sql-timestamp" type. The date type include timezone information, whereas the sql-timestamp type doesn't. This was fixed for 1.7 by https://openvpms.atlassian.net/browse/OBF-225 so that they are all stored as sql-timestamps.

Syndicate content