commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niklas Gustavsson <nik...@protocol7.com>
Subject Re: [transactions] No detection of failed deletion of file
Date Wed, 16 Nov 2005 17:32:20 GMT
Hi

actually it would help with our original case (that was caused by 
incorrect file rights on a Unix box). However, the test case I wrote do 
not use access rights but instead just keeps the open for writes as I 
didn't want to fiddle with the access rights from the unit test :-)

/niklas

Oliver Zeigermann wrote:
> Might actually work for this special case, but I would not want to
> make the code more complicated unless really needed. As you say that
> it does not really help with your problem I would rather vote against
> introducing it.
> 
> Thoughs?
> 
> Oliver
> 
> 2005/11/15, Niklas Gustavsson <niklas@protocol7.com>:
> 
>>If that test (File.canWrite()) was executed during deleteResource() and
>>if failing it would directly throw an Exception. That would mean that we
>>get the exception before the commit. Now, this won't fix my test case as
>>canWrite() doesn't detect write-locked files but I guess it could work
>>for cases where you do not have the necessary file access. What do you
>>think?
>>
>>/niklas
>>
>>Oliver Zeigermann wrote:
>>
>>>Yes, I think so. But if you tried it would not fail before commit.
>>>
>>>Oliver
>>>
>>>2005/11/13, Niklas Gustavsson <niklas@protocol7.com>:
>>>
>>>
>>>>Hi
>>>>
>>>>well, I'm not sure how to do this either. Could File.canWrite() be an
>>>>indication?
>>>>
>>>>/niklas
>>>>
>>>>
>>>>Oliver Zeigermann wrote:
>>>>
>>>>
>>>>>You are right. It would be desirable to make it fail as soon as
>>>>>possible. This would mean, however, that you touch the original file
>>>>>as soon as you try to delete it and not only when you commit the
>>>>>transaction. But the philosophy if this transactional implementation
>>>>>is not to touch the original file before commit. There are other
>>>>>implementations imaginable that make all the modifications on the
>>>>>original file but keep a backup for rollback, though.
>>>>>
>>>>>Thus, in short, the answer is that I do not know how to check this
>>>>>earlier given this implementation, but with others it would be
>>>>>possible.
>>>>>
>>>>>But, maybe, I am just not smart enough to find a solution ;)
>>>>>
>>>>>Oliver
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>>
>>


-- 
-------
Niklas Gustavsson
http://www.protocol7.com
mailto:niklas@protocol7.com


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message