Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 8639 invoked from network); 12 Oct 2004 19:50:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 12 Oct 2004 19:50:38 -0000 Received: (qmail 45325 invoked by uid 500); 12 Oct 2004 19:50:07 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 45272 invoked by uid 500); 12 Oct 2004 19:50:07 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@geronimo.apache.org Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 45246 invoked by uid 99); 12 Oct 2004 19:50:06 -0000 X-ASF-Spam-Status: No, hits=-10.0 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Tue, 12 Oct 2004 12:50:06 -0700 Received: (qmail 8246 invoked by uid 65534); 12 Oct 2004 19:50:05 -0000 Date: 12 Oct 2004 19:50:05 -0000 Message-ID: <20041012195005.8243.qmail@minotaur.apache.org> From: djencks@apache.org To: scm@geronimo.apache.org Subject: svn commit: rev 54691 - geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/log X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Author: djencks Date: Tue Oct 12 12:50:04 2004 New Revision: 54691 Modified: geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/log/HOWLLog.java Log: avoid problems if the tx we are rollng back wasn't prepared Modified: geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/log/HOWLLog.java ============================================================================== --- geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/log/HOWLLog.java (original) +++ geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/log/HOWLLog.java Tue Oct 12 12:50:04 2004 @@ -54,11 +54,8 @@ import org.objectweb.howl.log.ReplayListener; /** - * - * * @version $Rev$ $Date$ - * - * */ + */ public class HOWLLog implements TransactionLog, GBeanLifecycle { static final byte PREPARE = 1; static final byte COMMIT = 2; @@ -77,21 +74,19 @@ private final SortedSet marks = new TreeSet(); - public HOWLLog( - String bufferClassName, - int bufferSize, - boolean checksumEnabled, - int flushSleepTimeMilliseconds, - String logFileDir, - String logFileExt, - String logFileName, - int maxBlocksPerFile, - int maxBuffers, - int maxLogFiles, - int minBuffers, - int threadsWaitingForceThreshold, - ServerInfo serverInfo - ) throws IOException, LogConfigurationException { + public HOWLLog(String bufferClassName, + int bufferSize, + boolean checksumEnabled, + int flushSleepTimeMilliseconds, + String logFileDir, + String logFileExt, + String logFileName, + int maxBlocksPerFile, + int maxBuffers, + int maxLogFiles, + int minBuffers, + int threadsWaitingForceThreshold, + ServerInfo serverInfo) throws IOException, LogConfigurationException { this.serverInfo = serverInfo; setBufferClassName(bufferClassName); setBufferSizeKBytes(bufferSize); @@ -324,8 +319,10 @@ boolean doMark = false; Long mark = new Long(logMark); synchronized (marks) { - doMark = (mark.equals(marks.first())); - marks.remove(mark); + if (!marks.isEmpty()) { + doMark = (mark.equals(marks.first())); + marks.remove(mark); + } } return doMark; }