[ZODB-Dev] transactions discussion - common question

friedrich steindl zope at floSoft.net
Sat Jul 31 11:13:41 EDT 2004


hi all,

i followed your threads about 'API for dooming transactions' for some time and 
this caused me to think about making an object interface (which is mapping 
python objects to mysql) transactional

the interface is capable of storing versions of objects (a version is a new 
object which is double linked to the predecessor) and i think its a not so 
big step to make the thing transactional (puhh, really ???)

of course i have an overall idea about transactions (must provide ACID, ...) 
but thats very theoretical and in practice i am sure i will face a lot of 
problems i don't think of now

googling didn't bring me a satisfying document, maybe sombody knows about a 
good technical description of transactional features ...

so i would like to present a first glance about realization (during the lazy 
summer month - i didn't tell which year :-) and ask for comments on topics 
where i err or miss something

------------------------------------------------------------------------------------

starting point - 
-  -  -  -  -  -  -
as said before - is an interface that can store (python)objects with versions 
to mysql


what has to be done -
-  -  -  -  -  -  -  -  -  -  

short version:

build a <transaction object>, which can contain several data-objects;
on commit() it will save a new version of _all_ objects or do nothing (except 
raising an error)

longer version:

if something goes wrong during saving new versions (reason is mainly that 
objects are locked by others) the transaction object can rollback = delete 
already created new versions and keep the original versions recent

rollback can fail too (e.g. machine breaks down) - that makes me feel ;-) that 
the transaction object has to be persistant itsself and store every changing 
state of the transaction to the DB, so that after rebooting the machine, the 
transaction can be rolled back to the starting point (= go back one version 
for already changed objects)

deleteObject is not deleting but saving an empty new version (for rollback 
possibility)

------------------------------------------------------------------------------------

this is my first and probably not so realistic approach

perhaps you can convince me with some words to stick to the beatles ('let it 
be')



<tia> for everybody investing time


steindl friedrich
      (-:fs)




More information about the ZODB-Dev mailing list