diff -Naur ZODB-temp/Connection.py ZODB/Connection.py --- ZODB-temp/Connection.py Sat Sep 25 09:46:08 1999 +++ ZODB/Connection.py Sat Sep 25 09:42:26 1999 @@ -121,6 +121,7 @@ def __init__(self, version='', cache_size=400, cache_deactivate_after=60): """Create a new Connection""" + self.transaction = None self._version=version self._cache=cache=PickleCache(self, cache_size, cache_deactivate_after) self._incrgc=self.cacheGC=cache.incrgc diff -Naur ZODB-temp/DB.py ZODB/DB.py --- ZODB-temp/DB.py Sat Sep 25 09:46:08 1999 +++ ZODB/DB.py Tue Oct 24 09:13:58 2000 @@ -382,6 +382,7 @@ Note that the connection pool is managed as a stack, to increate the likelihood that the connection's stack will include useful objects. """ + orig_transaction = transaction if type(version) is not StringType: raise POSException.Unimplemented, 'temporary versions' @@ -408,6 +409,10 @@ cache_deactivate_after= self._version_cache_deactivate_after) c._setDB(self) + if orig_transaction: + c.transaction = orig_transaction + else: + c.transaction = get_transaction() self._temps.append(c) if transaction is not None: transaction[id(c)]=c return c @@ -497,6 +502,10 @@ c=pool[-1] del pool[-1] c._setDB(self) + if orig_transaction: + c.transaction = orig_transaction + else: + c.transaction = get_transaction() for pool, allocated in pooll: for cc in pool: cc._incrgc() diff -Naur ZODB-temp/__init__.py ZODB/__init__.py --- ZODB-temp/__init__.py Sat Sep 25 09:46:10 1999 +++ ZODB/__init__.py Sat Sep 25 09:33:08 1999 @@ -114,4 +114,3 @@ from DB import DB import Transaction -del Transaction diff -Naur ZODB-temp/cPersistence.c ZODB/cPersistence.c --- ZODB-temp/cPersistence.c Sat Sep 25 09:46:10 1999 +++ ZODB/cPersistence.c Tue Oct 24 09:52:22 2000 @@ -244,6 +244,29 @@ static int changed(cPersistentObject *self) { + PyObject *T; + if ((self->state == cPersistent_UPTODATE_STATE || + self->state == cPersistent_STICKY_STATE) + && self->jar) + { + ASSIGN(T,PyObject_GetAttrString(self->jar, "transaction")); + if (PyObject_IsTrue(T)) + { + ASSIGN(T, PyObject_GetAttrString(T, "register")); + UNLESS (T) return -1; + ASSIGN(T, PyObject_CallFunction(T, "O", self)); + if (T) Py_DECREF(T); + else return -1; + self->state=cPersistent_CHANGED_STATE; + } + } + + return 0; +} + +static int +xchanged(cPersistentObject *self) +{ static PyObject *builtins=0, *get_transaction=0, *py_register=0; PyObject *T;