[Zope-CVS] CVS: Products/Ape/lib/apelib/core - gateways.py:1.7.2.6 interfaces.py:1.9.2.8

Shane Hathaway shane at zope.com
Thu Dec 25 23:23:03 EST 2003


Update of /cvs-repository/Products/Ape/lib/apelib/core
In directory cvs.zope.org:/tmp/cvs-serv7640/lib/apelib/core

Modified Files:
      Tag: ape-0_8-branch
	gateways.py interfaces.py 
Log Message:
Renamed ConflictError to OIDConflictError.

ZODB conflict errors are related to high load and can be solved by
improving capacity.  OID conflicts, OTOH, are really programming errors.
They indicate that someone is trying to write different objects for 
a single OID.


=== Products/Ape/lib/apelib/core/gateways.py 1.7.2.5 => 1.7.2.6 ===
--- Products/Ape/lib/apelib/core/gateways.py:1.7.2.5	Sat Dec 20 23:24:03 2003
+++ Products/Ape/lib/apelib/core/gateways.py	Thu Dec 25 23:22:32 2003
@@ -18,7 +18,7 @@
 
 import time
 
-from interfaces import IGateway, ConflictError
+from interfaces import IGateway, OIDConflictError
 
 
 class CompositeGateway:
@@ -116,7 +116,7 @@
 
     def store(self, event, data):
         if event.is_new and self.data.has_key(event.oid):
-            raise ConflictError(event.oid)
+            raise OIDConflictError(event.oid)
         h = time.time()
         self.data[event.oid] = (data, h)
         return h


=== Products/Ape/lib/apelib/core/interfaces.py 1.9.2.7 => 1.9.2.8 ===
--- Products/Ape/lib/apelib/core/interfaces.py:1.9.2.7	Tue Dec 23 00:52:35 2003
+++ Products/Ape/lib/apelib/core/interfaces.py	Thu Dec 25 23:22:32 2003
@@ -40,11 +40,8 @@
 class ConfigurationError(Exception):
     """Invalid mapper configuration"""
 
-try:
-    from ZODB.POSException import ConflictError
-except ImportError:
-    class ConflictError(Exception):
-        """Conflicting OIDs or data"""
+class OIDConflictError(Exception):
+    """Attempt to write an object with an OID already in use"""
 
 
 class IClassFactory(Interface):
@@ -145,9 +142,9 @@
     is_new = Attribute(__doc__="""True if the object is new.
 
     When this attribute is true, gateways should not overwrite
-    existing data but instead raise a ConflictError if something is in
-    the way.  When it is false, gateways should overwrite existing
-    data.
+    existing data but instead raise an OIDConflictError if something
+    is in the way.  When it is false, gateways should overwrite
+    existing data.
     """)
 
 




More information about the Zope-CVS mailing list