[Zope3-dev] Re: [Zope3-checkins] CVS: Zope3/lib/python/Transaction - Manager.py:1.1 Transaction.py:1.1 IDataManager.py:1.3 ITransaction.py:1.3 __init__.py:1.3 _defaultTransaction.py:1.5

Gary Poster gary@modernsongs.com
Sun, 28 Jul 2002 23:55:09 -0400


So...we've got True and False in here....so I guess we're only supposed to
run Zope3 on Python CVS now (which I assume has a boolean type and constants
now)?  Or am I missing something obvious?

Gary


> === Added File Zope3/lib/python/Transaction/Manager.py ===
> from IDataManager import IRollback
> from Transaction import Transaction, Status
>
> # XXX need to change asserts of transaction status into explicit checks
> # that raise some exception
>
> # XXX need lots of error checking
>
> class TransactionManager(object):
>
>     txn_factory = Transaction
>
>     def __init__(self):
>         pass
>
>     def new(self):
>         return self.txn_factory(self)
>
>     def commit(self, txn):
>         assert txn._status is Status.ACTIVE
>         prepare_ok = True
>         for r in txn._resources:
>             if prepare_ok and not r.prepare(txn):
>                 prepare_ok = False
...