directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gokt...@apache.org
Subject svn commit: r1384626 - /directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/DefaultTxnManager.java
Date Fri, 14 Sep 2012 01:39:16 GMT
Author: gokturk
Date: Fri Sep 14 01:39:16 2012
New Revision: 1384626

URL: http://svn.apache.org/viewvc?rev=1384626&view=rev
Log:
Not necessary code replaced: Txn can't slip since we already have locks.

Modified:
    directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/DefaultTxnManager.java

Modified: directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/DefaultTxnManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/DefaultTxnManager.java?rev=1384626&r1=1384625&r2=1384626&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/DefaultTxnManager.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/DefaultTxnManager.java
Fri Sep 14 01:39:16 2012
@@ -595,25 +595,8 @@ class DefaultTxnManager implements TxnMa
         txn.setOptimisticLockHeld();
         txn.setLogicalDataVersion( logicalDataVersion );
 
-        /*
-         * Set the start time as the latest committed txn's commit time. We need to make
sure that
-         * any change after our start time is not flushed to the partitions. Say we have
txn1 as the
-         * lastest committed txn. There is a small window where we get ref to txn1, txn2
commits and
-         * becomes the latest committed txn, txn1's ref count becomes zero before we bump
its ref
-         * count and changes to txn2 are flushed to partitions. Below we loop until we make
sure
-         * that the txn for which we bumped up the ref count is indeed the latest committed
txn.
-         */
-        do
-        {
-            if ( lastTxnToCheck != null )
-            {
-                lastTxnToCheck.getRefCount().decrementAndGet();
-            }
-
-            lastTxnToCheck = latestCommittedTxn.get();
-            lastTxnToCheck.getRefCount().getAndIncrement();
-        }
-        while ( lastTxnToCheck != latestCommittedTxn.get() );
+        lastTxnToCheck = latestCommittedTxn.get();
+        lastTxnToCheck.getRefCount().getAndIncrement();
 
         // Determine start time
         long startTime;



Mime
View raw message