Update of /cvsroot/modeling/ProjectModeling/Modeling
In directory sc8-pr-cvs1:/tmp/cvs-serv13683
Modified Files:
DatabaseChannel.py
Log Message:
Reverted the "enhancement" made in the previous version: while enhancing perfs
when no obejcts were modified, it was dramatically (I mean that) slow when a
lot of objects were modified.
Index: DatabaseChannel.py
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/Modeling/DatabaseChannel.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** DatabaseChannel.py 18 Jul 2003 11:44:46 -0000 1.15
--- DatabaseChannel.py 18 Jul 2003 13:37:03 -0000 1.16
***************
*** 153,185 ****
if self.fetchesRawRows():
ec=self._editingContext
! ## Implementation note:
! # we formerly had the straighforward code:
! # object=ec.objectForGlobalID(globalID)
! # if object is not None:
! # return object.snapshot_raw()
! #
! # This works, but the more objects were already loaded within the
! # EditingContext, the slower it was. So we changed it to this version,
! # which does not have this drawback. However, obviously, the more
! # updated objects we have in the EditingContext, the slower it will be.
! # This CANNOT be changed: if an object is modified, its current state
! # should be reflected in the result set.
! if globalID in ec.allUpdatedGlobalIDs():
! return ec.objectForGlobalID(globalID).snapshot_raw()
! else:
! # Check the database cache: if it's already cached, use the cached
! # snapshot instead of the row coming from the db. If we do not do
! # this and the row has been changed independently from the framework,
! # then we'll get the raw snapshot and the corresponding object not
! # exposing the same values --and we do not want that, this is not
! # our problem here, rather, this would be handled w/ optimistic
! # locking.
! database=self.databaseContext().database()
! registeredSnapshot=database.snapshotForGlobalID(globalID)
! if registeredSnapshot:
! return registeredSnapshot
else:
! return dict
!
# Get snapshot
#snapshot=self._currentEntity.snapshotForRow(dict)
--- 153,170 ----
if self.fetchesRawRows():
ec=self._editingContext
! object=ec.objectForGlobalID(globalID)
! if object is not None:
! if not object.isFault():
! return object.snapshot_raw()
else:
! database=self.databaseContext().database()
! registeredSnapshot=database.snapshotForGlobalID(globalID)
! if registeredSnapshot:
! return registeredSnapshot
! else:
! return dict
! else:
! return dict
!
# Get snapshot
#snapshot=self._currentEntity.snapshotForRow(dict)
|