ZODB: Solutions similar to SQL triggers?
How would I replicate the benefits of SQL triggers in ZODB? -- Phillip B Oldham phillip.oldham@gmail.com +44 (0) 7525 01 09 01
--On 12. September 2008 09:25:14 +0100 Phillip B Oldham <phillip.oldham@gmail.com> wrote:
How would I replicate the benefits of SQL triggers in ZODB?
No idea what your particular usecase is but the transaction module provides support for pre- and post-commit hooks beyond the standard DataManager functionality. -aj
On Fri, Sep 12, 2008 at 10:00 AM, Andreas Jung <lists@zopyx.com> wrote:
--On 12. September 2008 09:25:14 +0100 Phillip B Oldham <phillip.oldham@gmail.com> wrote:
How would I replicate the benefits of SQL triggers in ZODB? No idea what your particular usecase is but the transaction module provides support for pre- and post-commit hooks beyond the standard DataManager functionality.
Essentially I'm looking to put listeners on certain items which trigger updates on other items. For instance, in MySQL I would put a trigger on a InnoDB table on insert, which would then insert the same data into a number optimised-for-reads MyISAM tables. Another example would be to cascade deletes through a schema in MySQL (as it doesn't currently have this feature). I'm simply wondering whether its possible to put a listener on a persisted object so that it executes some logic once something happens. -- Phillip B Oldham phillip.oldham@gmail.com +44 (0) 7525 01 09 01
--On 12. September 2008 10:13:20 +0100 Phillip B Oldham <phillip.oldham@gmail.com> wrote:
On Fri, Sep 12, 2008 at 10:00 AM, Andreas Jung <lists@zopyx.com> wrote:
--On 12. September 2008 09:25:14 +0100 Phillip B Oldham <phillip.oldham@gmail.com> wrote:
How would I replicate the benefits of SQL triggers in ZODB? No idea what your particular usecase is but the transaction module provides support for pre- and post-commit hooks beyond the standard DataManager functionality.
Essentially I'm looking to put listeners on certain items which trigger updates on other items. For instance, in MySQL I would put a trigger on a InnoDB table on insert, which would then insert the same data into a number optimised-for-reads MyISAM tables. Another example would be to cascade deletes through a schema in MySQL (as it doesn't currently have this feature).
I'm simply wondering whether its possible to put a listener on a persisted object so that it executes some logic once something happens.
Sound as if you want to use the event system of Zope in some way... -aj
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Phillip B Oldham wrote:
On Fri, Sep 12, 2008 at 10:00 AM, Andreas Jung <lists@zopyx.com> wrote:
--On 12. September 2008 09:25:14 +0100 Phillip B Oldham <phillip.oldham@gmail.com> wrote:
How would I replicate the benefits of SQL triggers in ZODB? No idea what your particular usecase is but the transaction module provides support for pre- and post-commit hooks beyond the standard DataManager functionality.
Essentially I'm looking to put listeners on certain items which trigger updates on other items. For instance, in MySQL I would put a trigger on a InnoDB table on insert, which would then insert the same data into a number optimised-for-reads MyISAM tables. Another example would be to cascade deletes through a schema in MySQL (as it doesn't currently have this feature).
I'm simply wondering whether its possible to put a listener on a persisted object so that it executes some logic once something happens.
At the application level, we ordinarily do this by publishing an event announcing the object creation / modification / deletion: the database doesn't handle this stuff at all. Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIyj4p+gerLs4ltQ4RAi1OAJ9/HWxKHH4hxLsFaQCe82AYAKaAeQCfYQIr 5JWNqZ9lsNexjvtgBO6eWLY= =8OmE -----END PGP SIGNATURE-----
participants (3)
-
Andreas Jung -
Phillip B Oldham -
Tres Seaver