-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: Envers revision end timestamp UTC
PostPosted: Wed May 11, 2016 11:50 am 
Newbie

Joined: Wed May 11, 2016 11:11 am
Posts: 4
Hello,
we are developing an application with hibernate 4.2.21 and jboss 6.3.
We annotate entities with @Audited and when create a record, one record is inserted in _history table but REV_END_TIMESTAMP value is not in UTC mode.

Code:
ID_COMPANY      NAME       REVISION    REV_TYPE   REV_END   REV_TIMESATAMP
xxxxx         Company 1..  2279        0                    2016-05-11 17:00:59 (NON UTC)


in updates, REV_END_TIMESTAMP changes to utc value but las update persists in non utc value.
Code:
ID_COMPANY      NAME       REVISION    REV_TYPE   REV_END   REV_TIMESATAMP
xxxxx         Company 1    2279         0          2280       2016-05-11 15:00:12 (UTC)      
xxxxx         Company 1.   2280         1          2281       2016-05-11 15:00:59 (UTC)      
xxxxx         Company 1..  2281         1                     2016-05-11 17:00:59 (NON UTC)


Envers properties
Code:
            <property name="org.hibernate.envers.audit_table_suffix" value="_HISTORY"/>
            <property name="org.hibernate.envers.revision_field_name" value="REVISION"/>
            <property name="org.hibernate.envers.revision_type_field_name" value="REV_TYPE"/>
            <property name="org.hibernate.envers.audit_strategy" value="org.hibernate.envers.strategy.ValidityAuditStrategy"/>
            <property name="org.hibernate.envers.audit_strategy_validity_store_revend_timestamp" value="true"/>
            <property name="org.hibernate.envers.audit_strategy_validity_end_rev_field_name" value="REV_END"/>
            <property name="org.hibernate.envers.audit_strategy_validity_revend_timestamp_field_name" value="REV_END_TIMESTAMP"/>
            <property name="org.hibernate.envers.track_entities_changed_in_revision" value="true"/>


Is there a way to have all rev_end_timestamp in utc mode?

Kind regards.

Marcel.


Last edited by marcelr34 on Tue May 17, 2016 5:40 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Envers revision end timestamp UTC
PostPosted: Mon May 16, 2016 8:01 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
I didn't understand what urc mode means.


Top
 Profile  
 
 Post subject: Re: Envers revision end timestamp UTC
PostPosted: Tue May 17, 2016 5:39 am 
Newbie

Joined: Wed May 11, 2016 11:11 am
Posts: 4
oh, sorry, it is a mistake
Wanted to say in utc mode


Top
 Profile  
 
 Post subject: Re: Envers revision end timestamp UTC
PostPosted: Wed May 25, 2016 6:27 am 
Newbie

Joined: Wed May 25, 2016 6:19 am
Posts: 1
I dont see any hook to manage timezone that envers is defaulting to.
Instead I ended up defaulting JVM process's timezone. It seems to be working.

-Duser.timezone="Etc/UTC"
OR
TimeZone.setDefault(TimeZone.getTimeZone(ZoneId.of("UTC")));


Top
 Profile  
 
 Post subject: Re: Envers revision end timestamp UTC
PostPosted: Fri May 27, 2016 7:09 am 
Newbie

Joined: Wed May 11, 2016 11:11 am
Posts: 4
any idea to solve this problem?

Thanks.


Top
 Profile  
 
 Post subject: Re: Envers revision end timestamp UTC
PostPosted: Thu Jul 07, 2016 6:50 am 
Newbie

Joined: Wed May 11, 2016 11:11 am
Posts: 4
Hello,
in our standalone.conf.bat have this property to set timezone

set "JAVA_OPTS=%JAVA_OPTS% -Duser.timezone=UTC"

wagleg, you mean to put it here with this value?

Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.