Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 44427 invoked from network); 15 Sep 2006 15:18:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 15 Sep 2006 15:18:41 -0000 Received: (qmail 60556 invoked by uid 500); 15 Sep 2006 15:18:38 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 60243 invoked by uid 500); 15 Sep 2006 15:18:37 -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 60229 invoked by uid 99); 15 Sep 2006 15:18:37 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Sep 2006 08:18:37 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of oliver.zeigermann@gmail.com designates 66.249.92.173 as permitted sender) Received: from [66.249.92.173] (HELO ug-out-1314.google.com) (66.249.92.173) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Sep 2006 08:18:27 -0700 Received: by ug-out-1314.google.com with SMTP id s2so200329uge for ; Fri, 15 Sep 2006 08:17:27 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=lwmzautsOveBrOa8pqMO6ZtFG1HwtaltVDzff4zbNrPqbly4mjP84Thyvvu2TfSHuByGz8qH4hgvwR5KUdPZl2NY7sCrnI2oFfWCk0guPwKomHsTXcPuwubFJTFJv8g1mbyLPsuqICfnPnNyfwFcl9ip5Q1qdEZlVvk1g56jLW4= Received: by 10.66.220.17 with SMTP id s17mr5440924ugg; Fri, 15 Sep 2006 08:17:26 -0700 (PDT) Received: by 10.66.239.19 with HTTP; Fri, 15 Sep 2006 08:17:26 -0700 (PDT) Message-ID: <9da4f4520609150817v90e266amc2131e09962fd14c@mail.gmail.com> Date: Fri, 15 Sep 2006 17:17:26 +0200 From: "Oliver Zeigermann" To: "Jakarta Commons Developers List" Subject: Re: Regarding apache commons file transactions ~script In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Praven! You have to delete the file using the FileResourceManager. Oliver 2006/9/15, Praveen Kumar : > *** CAUTION *** > > The sender of this email has requested that its content is not checked > for potentially mailicious scripts. Therefore this email has been virus > checked, but advanced content security checks have not been carried > out. Please take extra care when handling this email and any associated > attachments. The original message now follows. > ________________________________________________________________ > > Hi, > > > > I need your help to solve my technical problem. Many thanks in > > advance. > > > > I am using apache commons file transactions for my application. As per > > my requirement i have to rollback the file deletion if any abnormal > > condition occurs in a transaction. For that i wrote below code. > > > > > > Logger logger = > > Logger.getLogger(test.class.getName()); > > LoggerFacade sLogger = new Jdk14Logger(logger); > > > > FileResourceManager frm = new > > FileResourceManager("store", "work", false, sLogger, true); > > Object txId = getTranscationId(new Date().getTime()); > > try { > > frm.start(); > > frm.prepareTransaction(txId); > > frm.startTransaction(txId); > > frm.lockResource(url, txId); > > FileHelper fh = new > > FileHelper(); > > fh.deleteFile(url); > > frm.commitTransaction(txId); > > } catch (ResourceManagerException e) { > > try { > > frm.rollbackTransaction(txId); > > } > > > > > > When i test the above code by placing "throw new > > ResourceManagerException()" after fh.deleteFile(url) statement, by > > commenting the frm.commitTransaction(txId) statement, the control is > > coming to catch block. But, file deletion can't rollback. I mean after > > transaction rollback the file doesn't place in actual directory. > > > > One more doubt using apache commons, can i delete a file which is > > exist in remote server? > > > > Kindly, help me. Awaiting for your reply. > > > > Thanks & Regards, > > Praveen > > This communication is confidential and intended solely for the addressee(s). Any unauthorized review, use, disclosure or distribution is prohibited. If you believe this message has been sent to you in error, please notify the sender by replying to this transmission and delete the message without disclosing it. Thank you. > > E-mail including attachments is susceptible to data corruption, interruption, unauthorized amendment, tampering and viruses, and we only send and receive e-mails on the basis that we are not liable for any such corruption, interception, amendment, tampering or viruses or any consequences thereof. > > > ______________________________________________________________________ > This email has been scanned by the MessageLabs Email Security System. > For more information please visit http://www.messagelabs.com/email > ______________________________________________________________________ > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org