commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Zeigermann (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (TRANSACTION-12) Use NIO for file copying/moving
Date Sat, 18 Aug 2007 21:43:30 GMT

     [ https://issues.apache.org/jira/browse/TRANSACTION-12?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Oliver Zeigermann resolved TRANSACTION-12.
------------------------------------------

    Resolution: Fixed

Copying and moving not benefits from NIO.

> Use NIO for file copying/moving
> -------------------------------
>
>                 Key: TRANSACTION-12
>                 URL: https://issues.apache.org/jira/browse/TRANSACTION-12
>             Project: Commons Transaction
>          Issue Type: Wish
>    Affects Versions: 1.2
>            Reporter: Holger Hoffstätte
>             Fix For: 2.0
>
>         Attachments: moveByRenameAndNIO.txt
>
>
> The Mule project (http://mule.codehaus.org/) is considering adoption of commons-transaction
for (among other things) file transactions. Unfortunately inspection of the code reveals that
FileHelper copies files in the slowest possible way (traditional Java I/O via Input/OutputStreams).
Since some of our users move lots and/or large files (hundreds of megabytes to gigabytes)
we implemented file moving by rename (atomic and obviously very fast when source and target
are on the same filesystem) and NIO as backup strategy (a lot less CPU usage).
> Attached is a code snippet that outlines the procedure; it would be cool if c-tx could
adopt a similar strategy for moving via rename-first and copy via NIO. I do not know if and
how this might conflict with c-tx's "transactional" behaviour and recovery but then again
it is just a suggestion. :-)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message