db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject cvs commit: jakarta-ojb/src/java/org/apache/ojb/odmg ObjectEnvelopeTable.java
Date Fri, 17 Jan 2003 18:03:35 GMT
thma        2003/01/17 10:03:35

  Modified:    src/java/org/apache/ojb/odmg ObjectEnvelopeTable.java
  Log:
  only mark onject implicitely dirty if they have not been marked during the transaction already.
  Safes time and improves semantics!
  
  Revision  Changes    Path
  1.14      +9 -5      jakarta-ojb/src/java/org/apache/ojb/odmg/ObjectEnvelopeTable.java
  
  Index: ObjectEnvelopeTable.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/odmg/ObjectEnvelopeTable.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- ObjectEnvelopeTable.java	9 Jan 2003 17:05:42 -0000	1.13
  +++ ObjectEnvelopeTable.java	17 Jan 2003 18:03:34 -0000	1.14
  @@ -182,12 +182,16 @@
                   ObjectEnvelope mod = (ObjectEnvelope) mhtObjectEnvelopes.get(iter.next());
                   if (log.isDebugEnabled()) log.debug("commit: " + mod);
                   // if the Object has been modified by transaction, mark object as dirty
  -                if (mod.hasChanged())
  +                // but only if it has not been marked during tx already !! 
  +                if ( (! mod.needsDelete()) && (! mod.needsInsert()) &&
(! mod.needsUpdate())  )
                   {
  -                    // implicitely acquire a write lock !
  -                    transaction.lock(mod.getObject(), Transaction.UPGRADE);
  -                    // mark object dirty
  -                    mod.setModificationState(mod.getModificationState().markDirty());
  +		            if (mod.hasChanged())
  +		            {
  +		                // implicitely acquire a write lock !
  +		                transaction.lock(mod.getObject(), Transaction.UPGRADE);
  +		                // mark object dirty
  +		                mod.setModificationState(mod.getModificationState().markDirty());
  +		            }
                   }
               }
   
  
  
  

Mime
View raw message