[ 
https://issues.apache.org/jira/browse/OAK-3645?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15093638#comment-15093638
 ] 

Julian Reschke commented on OAK-3645:
-------------------------------------

For Derby,

{code}
        @Override
        public String getInitializationStatement() {
            return "create function unixtime() returns bigint parameter style 
java no sql language java external name 'java.lang.System.currentTimeMillis'";
        }

        @Override
        public String getCurrentTimeStampInSecondsSyntax() {
            return "values unixtime() / 1000";
        }
{code}

would work except that we'd need something like "create function if not exists".

> RDBDocumentStore: server time detection for DB2 fails due to timezone/dst 
> differences
> -------------------------------------------------------------------------------------
>
>                 Key: OAK-3645
>                 URL: https://issues.apache.org/jira/browse/OAK-3645
>             Project: Jackrabbit Oak
>          Issue Type: Technical task
>          Components: rdbmk
>    Affects Versions: 1.3.10, 1.2.8, 1.0.24
>            Reporter: Julian Reschke
>            Assignee: Tomek Rękawek
>         Attachments: OAK-3645-jr.patch, OAK-3645.patch
>
>
> We use {{CURRENT_TIMESTAMP(4)}} to ask the DB for it's system time.
> Apparently, at least with DB2, this might return a value that is off by a 
> multiple of one hour (3600 * 1000ms) depending on whether the OAK instance 
> and the DB run in different timezones.
> Known to work: both on the same machine.
> Known to fail: OAK in CET, DB2 in UTC, in which case we're getting a 
> timestamp one hour in the past.
> At this time it's not clear whether the same problem occurs for other 
> databases.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to