Update of /cvsroot/modeling/ProjectModeling/Modeling
In directory sc8-pr-cvs1:/tmp/cvs-serv29562
Modified Files:
DatabaseChannel.py
Log Message:
Fixed selectObjectsWithFetchSpecification(): should cancelfetch() when something goes wrong
Index: DatabaseChannel.py
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/Modeling/DatabaseChannel.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** DatabaseChannel.py 6 May 2003 12:20:32 -0000 1.12
--- DatabaseChannel.py 6 May 2003 13:21:29 -0000 1.13
***************
*** 348,369 ****
raise RuntimeError, 'a fetch in already in progress'
self.__isFetchInProgress=1
! # Reinitializes settings
! self.setCurrentEditingContext(anEditingContext)
! import ModelSet
! defModelSet=ModelSet.defaultModelSet()
! entity=defModelSet.entityNamed(aFetchSpecification.entityName())
! self.setCurrentEntity(entity)
! self.setIsLocking(aFetchSpecification.locksObjects())
! self.setIsRefreshingObjects(aFetchSpecification.refreshesRefetchedObjects())
! # Get an adaptorChannel
! if not self._adaptorChannel.isOpen():
! self._adaptorChannel.openChannel()
!
! #self._adaptorChannel.executeExpression(sqlExpr)
! self._adaptorChannel.selectAttributes(entity.attributesToFetch(),
! aFetchSpecification,
! self._isLocking,
! entity)
def setCurrentEditingContext(self, anEditingContext):
"""
--- 348,374 ----
raise RuntimeError, 'a fetch in already in progress'
self.__isFetchInProgress=1
! try:
! # Reinitializes settings
! self.setCurrentEditingContext(anEditingContext)
! import ModelSet
! defModelSet=ModelSet.defaultModelSet()
! entity=defModelSet.entityNamed(aFetchSpecification.entityName())
! self.setCurrentEntity(entity)
! self.setIsLocking(aFetchSpecification.locksObjects())
! self.setIsRefreshingObjects(aFetchSpecification.refreshesRefetchedObjects())
! # Get an adaptorChannel
! if not self._adaptorChannel.isOpen():
! self._adaptorChannel.openChannel()
+ #self._adaptorChannel.executeExpression(sqlExpr)
+ self._adaptorChannel.selectAttributes(entity.attributesToFetch(),
+ aFetchSpecification,
+ self._isLocking,
+ entity)
+ except:
+ # If something went wrong we must cancel the fetch in progress
+ self.cancelFetch()
+ raise
+
def setCurrentEditingContext(self, anEditingContext):
"""
|