directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1226577 - /directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/DefaultTxnManager.java
Date Mon, 02 Jan 2012 23:48:09 GMT
Author: elecharny
Date: Mon Jan  2 23:48:09 2012
New Revision: 1226577

URL: http://svn.apache.org/viewvc?rev=1226577&view=rev
Log:
Correctly create the right type of transaction

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=1226577&r1=1226576&r2=1226577&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
Mon Jan  2 23:48:09 2012
@@ -177,12 +177,20 @@ class DefaultTxnManager implements TxnMa
     public Transaction beginTransaction( boolean readOnly ) throws Exception
     {
         Transaction curTxn = getCurTxn();
+        Transaction transaction = null;
 
         if ( curTxn != null )
         {
             if ( curTxn instanceof ReadOnlyTxn )
             {
-                Transaction transaction = beginReadOnlyTxn();
+                if ( readOnly )
+                {
+                    transaction = beginReadOnlyTxn();
+                }
+                else
+                {
+                    transaction = beginReadWriteTxn();
+                }
 
                 return transaction;
             }
@@ -193,16 +201,14 @@ class DefaultTxnManager implements TxnMa
 
         if ( readOnly )
         {
-            Transaction transaction = beginReadOnlyTxn();
-
-            return transaction;
+            transaction = beginReadOnlyTxn();
         }
         else
         {
-            Transaction transaction = beginReadWriteTxn();
-
-            return transaction;
+            transaction = beginReadWriteTxn();
         }
+
+        return transaction;
     }
 
 



Mime
View raw message