You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2007/09/12 10:00:58 UTC

svn commit: r574827 - /lenya/trunk/src/java/org/apache/lenya/transaction/UnitOfWorkImpl.java

Author: andreas
Date: Wed Sep 12 01:00:57 2007
New Revision: 574827

URL: http://svn.apache.org/viewvc?rev=574827&view=rev
Log:
UnitOfWorkImpl.isDirty() does also check for new and removed objects

Modified:
    lenya/trunk/src/java/org/apache/lenya/transaction/UnitOfWorkImpl.java

Modified: lenya/trunk/src/java/org/apache/lenya/transaction/UnitOfWorkImpl.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/transaction/UnitOfWorkImpl.java?rev=574827&r1=574826&r2=574827&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/transaction/UnitOfWorkImpl.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/transaction/UnitOfWorkImpl.java Wed Sep 12 01:00:57 2007
@@ -89,8 +89,8 @@
     }
 
     /**
-     * Commit the transaction. We lock this method for the whole class to avoid
-     * synchronization problems.
+     * Commit the transaction. We lock this method for the whole class to avoid synchronization
+     * problems.
      * @see org.apache.lenya.transaction.UnitOfWork#commit()
      */
     public void commit() throws TransactionException {
@@ -134,7 +134,7 @@
                 Transactionable t = (Transactionable) i.next();
                 t.deleteTransactionable();
             }
-    
+
         } finally {
             if (getIdentityMap() != null) {
                 Object[] objects = getIdentityMap().getObjects();
@@ -172,12 +172,14 @@
      * @see org.apache.lenya.transaction.UnitOfWork#isDirty(org.apache.lenya.transaction.Transactionable)
      */
     public boolean isDirty(Transactionable transactionable) {
-        return this.modifiedObjects.contains(transactionable);
+        return this.modifiedObjects.contains(transactionable)
+                || this.newObjects.contains(transactionable)
+                || this.removedObjects.contains(transactionable);
     }
 
     /**
-     * Rollback the transaction. We lock this method for the whole class to
-     * avoid synchronization problems.
+     * Rollback the transaction. We lock this method for the whole class to avoid synchronization
+     * problems.
      * @see org.apache.lenya.transaction.UnitOfWork#rollback()
      */
     public synchronized void rollback() throws TransactionException {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org