[Zope3-Users] Changing Storage to MySQL
Garrett Smith
garrett at mojave-corp.com
Thu Feb 17 12:02:15 EST 2005
I have some experience integrating a RDB into Zope 3, but I muck around
with __setstate__ and __getstate__ (the methods that the 'persistent'
framework uses for deserialization and serialization). I fire events
from these methods to let handlers read/write to the database as needed.
Zope 3 makes it easy to respond to events like:
- Objects removed from a folder (generally equivalent to row deletion in
an RDB)
- Objects added to a folder (~ row insertion in an RDB)
- Objected moved from one folder to another (depends on your app; maybe
location info in the DB updated)
But Zope 3 doesn't (seem to) make it easy to plug in an alternative
persistence mechanism for a particular object type. It doesn't feel
right to hard-wire RDB code in an object's serialization methods. But
these are events that people are undoubtedly interested in.
Perhaps it would be useful to have a Persistent super class, defined in
the zope/app package, that fires events like ObjectStateLoadedEvent and
ObjectStateSavedEvent.
I'm curious as to other Zope 3 users/developers experiences in this
area.
-- Garrett
Andreas Pauley wrote:
> Hi all,
>
> I just connected to a MySQL database using mysqldbda.
>
> Are there any Zope3 docs or examples available that will show me how
> to use mysql in a product?
>
> I'd like to (for example) change the messagboard or the buddydemo to
> use mysql instead of ZODB.
>
> This is just to illustrate the concept, I'm actually trying to write
> my own qt/zope/mysql app.
>
> Regards,
> Andreas
> _______________________________________________
> Zope3-users mailing list
> Zope3-users at zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users
More information about the Zope3-users
mailing list