geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: rev 54691 - geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/log
Date Tue, 12 Oct 2004 19:50:05 GMT
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;
     }

Mime
View raw message