Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 1027 invoked from network); 2 Sep 2006 21:54:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Sep 2006 21:54:50 -0000 Received: (qmail 26655 invoked by uid 500); 2 Sep 2006 21:54:48 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 26629 invoked by uid 500); 2 Sep 2006 21:54:48 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 26618 invoked by uid 99); 2 Sep 2006 21:54:48 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Sep 2006 14:54:48 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Sep 2006 14:54:48 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 45B7B41001F for ; Sat, 2 Sep 2006 21:51:23 +0000 (GMT) Message-ID: <7586338.1157233883283.JavaMail.jira@brutus> Date: Sat, 2 Sep 2006 14:51:23 -0700 (PDT) From: "Oliver Zeigermann (JIRA)" To: commons-dev@jakarta.apache.org Subject: [jira] Commented: (TRANSACTION-12) Use NIO for file copying/moving In-Reply-To: <2269734.1157213369603.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/TRANSACTION-12?page=3Dcomments#a= ction_12432306 ]=20 =20 Oliver Zeigermann commented on TRANSACTION-12: ---------------------------------------------- Renaming (rename-first as you call it) is already done by the current imple= mentation.=20 The current fall back strategy is used as commons transaction only requires= Java 1.3 which does not support NIO. It might be an option to have differe= nt implementations for pre 1.4 and post 1.4 JDKs though. Could you think of= something like that? > Use NIO for file copying/moving > ------------------------------- > > Key: TRANSACTION-12 > URL: http://issues.apache.org/jira/browse/TRANSACTION-12 > Project: Commons Transaction > Issue Type: Wish > Affects Versions: 1.2 > Reporter: Holger Hoffst=C3=A4tte > Attachments: moveByRenameAndNIO.txt > > > The Mule project (http://mule.codehaus.org/) is considering adoption of c= ommons-transaction for (among other things) file transactions. Unfortunatel= y inspection of the code reveals that FileHelper copies files in the slowes= t possible way (traditional Java I/O via Input/OutputStreams). Since some o= f our users move lots and/or large files (hundreds of megabytes to gigabyte= s) we implemented file moving by rename (atomic and obviously very fast whe= n 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 "transac= tional" behaviour and recovery but then again it is just a suggestion. :-) --=20 This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: htt= p://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org