[
https://jira.duraspace.org/browse/DS-775?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=19920#action_19920
]
Tim Ribaric commented on DS-775:
--------------------------------
The problem I hit here had to do with the call System.currentTimeMillis() It's
a long story but the machine I was testing on was a virtual one that got out of
sync with NTP. (There was no cron entry to force a re-sync) and the system
clock began to drift a few hours. After doing the multiplication of seconds
per millisecond, seconds per minute etc. the resulting date was no where near
the expected embargo lift date. The Java docs mention that results of this
call rely on the underlying operating system
(http://download.oracle.com/javase/1.5.0/docs/api/java/lang/System.html#currentTimeMillis()).
I wanted to re-do the calculation with a Java Class that was less susceptible
to these shifts in time so I ended up with Calendar. I don't think it hits
performance much by using this class given the additional accuracy in the
embargo calculation. Just my take on it.
Thanks,
Tim
> Implementation of DayTableEmbargoSetter.java not working as expected.
> ---------------------------------------------------------------------
>
> Key: DS-775
> URL: https://jira.duraspace.org/browse/DS-775
> Project: DSpace
> Issue Type: Bug
> Components: DSpace API
> Affects Versions: 1.7.0
> Reporter: Tim Ribaric
> Assignee: Mark H. Wood
> Priority: Major
> Attachments: DayTableEmbargoSetter_mod.java
>
>
> The original implementation of DayTableEmbargoSetter.java worked by grabbing
> the system time in milliseconds computing the embargo period in milliseconds
> adding the two and then casting into a Date. For whatever reason this never
> calculates correctly in all the test cases I attempted. I rewrote a few
> lines of the class to instead use a Calendar offset to figure out the Lift
> Date. I think this is a more reliable implementation but I'm happy to hear
> what others say.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.duraspace.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel