[Zodb-checkins] CVS: ZODB3/ZODB - BaseStorage.py:1.23

Jeremy Hylton jeremy@zope.com
Wed, 11 Sep 2002 13:07:34 -0400


Update of /cvs-repository/ZODB3/ZODB
In directory cvs.zope.org:/tmp/cvs-serv10536

Modified Files:
	BaseStorage.py 
Log Message:
Make tpc_begin() a read-only method.

The effect of this change will be to cause transactions to fail
immediately, rather than the first time they call store() or
abortVersion() or some other write-method.  Since the Connection now
treats empty transactions as a special case, this change will not
change the class of transactions that fail.


=== ZODB3/ZODB/BaseStorage.py 1.22 => 1.23 ===
--- ZODB3/ZODB/BaseStorage.py:1.22	Mon Sep  9 18:39:38 2002
+++ ZODB3/ZODB/BaseStorage.py	Wed Sep 11 13:07:34 2002
@@ -122,6 +122,8 @@
         pass
 
     def tpc_begin(self, transaction, tid=None, status=' '):
+        if self._is_read_only:
+            raise POSException.ReadOnlyError()
         self._lock_acquire()
         try:
             if self._transaction is transaction: