Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CFCC26925 for ; Wed, 22 Jun 2011 12:56:43 +0000 (UTC) Received: (qmail 44639 invoked by uid 500); 22 Jun 2011 12:56:43 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 44611 invoked by uid 500); 22 Jun 2011 12:56:43 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 44604 invoked by uid 99); 22 Jun 2011 12:56:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Jun 2011 12:56:43 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Jun 2011 12:56:41 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 8A542238896F; Wed, 22 Jun 2011 12:56:20 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1138443 - /activemq/trunk/kahadb/src/main/java/org/apache/kahadb/page/Transaction.java Date: Wed, 22 Jun 2011 12:56:20 -0000 To: commits@activemq.apache.org From: dejanb@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110622125620.8A542238896F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dejanb Date: Wed Jun 22 12:56:20 2011 New Revision: 1138443 URL: http://svn.apache.org/viewvc?rev=1138443&view=rev Log: https://issues.apache.org/jira/browse/AMQ-3374 - long kahadb tx - configurable max size and better tmp file name Modified: activemq/trunk/kahadb/src/main/java/org/apache/kahadb/page/Transaction.java Modified: activemq/trunk/kahadb/src/main/java/org/apache/kahadb/page/Transaction.java URL: http://svn.apache.org/viewvc/activemq/trunk/kahadb/src/main/java/org/apache/kahadb/page/Transaction.java?rev=1138443&r1=1138442&r2=1138443&view=diff ============================================================================== --- activemq/trunk/kahadb/src/main/java/org/apache/kahadb/page/Transaction.java (original) +++ activemq/trunk/kahadb/src/main/java/org/apache/kahadb/page/Transaction.java Wed Jun 22 12:56:20 2011 @@ -30,7 +30,7 @@ public class Transaction implements Iter private RandomAccessFile tmpFile; - private File txfFile; + private File txFile; private int nextLocation = 0; /** @@ -91,7 +91,7 @@ public class Transaction implements Iter // List of pages freed in this transaction private final SequenceSet freeList = new SequenceSet(); - private long maxTransactionSize = 10485760; + private long maxTransactionSize = Integer.parseInt(System.getProperty("maxKahaDBTxSize", "" + 10485760)); private long size = 0; @@ -654,7 +654,7 @@ public class Transaction implements Iter throw new IOException("Can't delete temporary KahaDB transaction file:" + getTempFile()); } tmpFile = null; - txfFile = null; + txFile = null; } } size = 0; @@ -678,7 +678,7 @@ public class Transaction implements Iter throw new IOException("Can't delete temporary KahaDB transaction file:" + getTempFile()); } tmpFile = null; - txfFile = null; + txFile = null; } } size = 0; @@ -693,10 +693,10 @@ public class Transaction implements Iter protected File getTempFile() { - if (txfFile == null) { - txfFile = new File(getPageFile().getDirectory(), IOHelper.toFileSystemSafeName(Long.toString(getWriteTransactionId())) + ".tmp"); + if (txFile == null) { + txFile = new File(getPageFile().getDirectory(), IOHelper.toFileSystemSafeName("tx-"+ Long.toString(getWriteTransactionId()) + "-" + Long.toString(System.currentTimeMillis()) + ".tmp")); } - return txfFile; + return txFile; } /**