[ZODB-Dev] Savepoints and Shared.DC.ZRDB.TM

Jim Fulton jim at zope.com
Wed Dec 21 06:55:20 EST 2005


Sidnei da Silva wrote:
> On Tue, Dec 20, 2005 at 11:51:16PM -0500, Tim Peters wrote:
> | [Tim Peters]
> | >> It's the traceback that's needed here.  You're working too hard ;-)
> | 
> | [Sidnei da Silva]
> | > Indeed.
> | >
> | >   File "C:\Arquivos de programas\Enfold
> | Server\Products\ATContentTypes\tests\atcttestcase.py", line 258, in
> | test_migrationKeepsPermissions
> | >     transaction.savepoint() # subtransaction
> | 
> | Bingo!  That's the root cause of it all.  This isn't Zope code, so I can't
> | know what it's trying to accomplish.  _Why_ is this code making a savepoint?
> | 
> | Since it throws away the result of the savepoint() call, it's not possible
> | to roll back to this savepoint's state later.  So the most likely reason is
> | that it's just "trying to save memory".  In that case, change the code to
> | 
> |     transaction.savepoint(optimistic=True)
> | 
> | and your original problem will go away.
> 
> I do understand that. But that doesn't answer the original question,
> which was:
> 
>  - Should Shared.DC.ZRDB.TM support (non-optimistic) savepoints?

That wasn't the original question.

The answer to this new question is no, it shouldn't, because it
can't.  Many uses of TM don;t provide for rollback.  Having noop
savepoint support would be harmful as Tim noted earlier.

It might be nice to have a new class that does provide savepoint support
and that requirs sibclasses to provide the necesssary code. This would
be useful for those relational databases that do provide savepoint support/

>>From what I understand, if the answer is yes then that class should be
> updated to use the new datamanager API instead of the old 'register'
> call, otherwise it just won't support non-optimistic savepoints at
> all.

The TM class is very very old.  We should look anew at the transaction
APIs and come up with the best way to integrate data managers into it.
I don't know if the best way to do that is with a base class, or whether a
adapters would be better or ...

Jim

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org


More information about the ZODB-Dev mailing list