You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Carsten Ziegeler <cz...@apache.org> on 2011/02/01 13:48:54 UTC

DataStoreException on Windows XP

Hi,

we have some tests that run perfectly fine on Mac OS X (and other unix
systems) but fail reproducable on windows XP. With JR 2.2.0 we get:

org.apache.jackrabbit.core.data.DataStoreException: Failed to update record
modified date: 2ac72495fd1e270777821b8a872903c79c84a8d9
        at
org.apache.jackrabbit.core.data.FileDataStore.addRecord(FileDataStore.java:250)
        at
org.apache.jackrabbit.core.value.BLOBInDataStore.getInstance(BLOBInDataStore.java:119)
        at
org.apache.jackrabbit.core.value.InternalValue.getBLOBFileValue(InternalValue.java:619)
        at
org.apache.jackrabbit.core.value.InternalValue.create(InternalValue.java:369)
        at
org.apache.jackrabbit.core.value.InternalValueFactory.create(InternalValueFactory.java:94)
        at
org.apache.jackrabbit.core.value.ValueFactoryImpl.createBinary(ValueFactoryImpl.java:74)
        at

(The issue happens with JR 2.2.2 as well)

Does this ring a bell to someone?

Regards
Carsten
-- 
Carsten Ziegeler
cziegeler@apache.org

Re: DataStoreException on Windows XP

Posted by Thomas Mueller <mu...@adobe.com>.
Hi,

It looks like if the file is still open for reading, then changing the
last modified date doesn't work for Windows XP. I could verify this using
the test case http://pastebin.com/HhKcCHXF

There is a workaround: open the file for writing, read one byte, seek to
the beginning, write the same byte, close the file. This is ugly, I hope
there is a better solution.

In any case, it's a bug. I created a new issue:
https://issues.apache.org/jira/browse/JCR-2872

Regards,
Thomas


Re: DataStoreException on Windows XP

Posted by Carsten Ziegeler <cz...@apache.org>.
Hi,

Jukka Zitting  wrote
> Hi,
> 
> On 02/01/2011 01:48 PM, Carsten Ziegeler wrote:
>> we have some tests that run perfectly fine on Mac OS X (and other unix
>> systems) but fail reproducable on windows XP. With JR 2.2.0 we get:
>>
>> org.apache.jackrabbit.core.data.DataStoreException: Failed to update
>> record
>> modified date: 2ac72495fd1e270777821b8a872903c79c84a8d9
> 
> Sounds like a virus scanner or some other low-level file system
> mechanism that interferes with file operations on Windows.
> 
I turned of the virus scanner, still the same problem; it's a standard
XP and others have reported the same problem with XP.

My first thought was that it's not possible to set the last modified to
the future (for whatever reason) - but I could remove this from the list
of suspects with a test.

What else could go wrong? I couldn't find any real reason why a
setLastModified should fail.

Regards
Carsten
-- 
Carsten Ziegeler
cziegeler@apache.org

Re: DataStoreException on Windows XP

Posted by Jukka Zitting <jz...@adobe.com>.
Hi,

On 02/01/2011 01:48 PM, Carsten Ziegeler wrote:
> we have some tests that run perfectly fine on Mac OS X (and other unix
> systems) but fail reproducable on windows XP. With JR 2.2.0 we get:
>
> org.apache.jackrabbit.core.data.DataStoreException: Failed to update record
> modified date: 2ac72495fd1e270777821b8a872903c79c84a8d9

Sounds like a virus scanner or some other low-level file system 
mechanism that interferes with file operations on Windows.

-- 
Jukka Zitting

Re: DataStoreException on Windows XP

Posted by Thomas Mueller <mu...@adobe.com>.
Hi,

It looks like a file access rights problem, but I think Jukka is right:
maybe it's caused by a virus scanner. The relevant code is:

if (!file.setLastModified(now + ACCESS_TIME_RESOLUTION)) {
    if (file.canWrite()) {
        throw new DataStoreException("Failed to update record modified
date: " + identifier);
    }
}


If it is in fact a virus scanner problem, we could add a workaround (maybe
re-trying a few time, with delay, works).

Regards,
Thomas