Zopistas! I want to write an Product that mirrors every ZODB-Transaction to a Backup-Server. The idea was to trap every transaction (i.e. creation, change, deletion of zope-objects) and transfer a copy of the object to another server (via XML-RPC?!?) after the transaction got commited. I've been debugging through various zope-classes (esp. transaction.py, connection.py) but couldn't understand the way, zope manages the transactions. The creation and deletion process always seems to trigger a transaction for the parent object. Has anybody an idea? Thanx, Gregor!
Heine, You'll want to take a look at lib/python/ZODB/FileStorage, lib/python/ZODB/DemoStorage, and lib/python/ZODB/MappingStorage for ideas. You may also want to take a look at the ZODB Wiki at http://www.zope.org/Members/jim/ZODB Heine Gregor wrote:
Zopistas!
I want to write an Product that mirrors every ZODB-Transaction to a Backup-Server. The idea was to trap every transaction (i.e. creation, change, deletion of zope-objects) and transfer a copy of the object to another server (via XML-RPC?!?) after the transaction got commited. I've been debugging through various zope-classes (esp. transaction.py, connection.py) but couldn't understand the way, zope manages the transactions. The creation and deletion process always seems to trigger a transaction for the parent object. Has anybody an idea?
Thanx,
Gregor!
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
-- Chris McDonough Digital Creations Publishers of Zope - http://www.zope.org
Heine Gregor wrote:
I want to write an Product that mirrors every ZODB-Transaction to a Backup-Server. The idea was to trap every transaction (i.e. creation, change, deletion of zope-objects) and transfer a copy of the object to another server (via XML-RPC?!?) after the transaction got commited. I've been debugging through various zope-classes (esp. transaction.py, connection.py) but couldn't understand the way, zope manages the transactions. The creation and deletion process always seems to trigger a transaction for the parent object. Has anybody an idea?
Data.fs is essentially a log file that is appended with binary data. The only time the data is changed rather than appended is when you pack the database. Therefore, it may be easier to write a script that catches the data that is appended and appends it to the backup file. When the script detects the file has shortened (after a packing operation), it should copy the whole file over. The simple fact that data is appended rather than changed makes Data.fs quite reliable. It can withstand most kinds of failure. And the Zope undo mechanism is very effective. So I would suggest that the backup you intend to perform does not need to be an integral part of Zope. Rather, it is appropriate that it be a background process run periodically. Shane
Shane Hathaway wrote:
Data.fs is essentially a log file that is appended with binary data. The only time the data is changed rather than appended is when you pack the database. Therefore, it may be easier to write a script that catches the data that is appended and appends it to the backup file. When the script detects the file has shortened (after a packing operation), it should copy the whole file over.
Someone alreay wrote a script that does this - search the archives or zope.org. -- Itamar S.T. itamar@maxnm.com
participants (4)
-
Chris McDonough -
Heine Gregor -
Itamar Shtull-Trauring -
Shane Hathaway