[Q] Pickle support for C wrapper and ZEO
Hi all, I'm reposting here because I had no luck on zope@zope.org. I'm in the course of low-level wrapping the ODBC api. Just in case you wonder: I know of mxODBC and pyodbc, they don't fit my needs as well license-wise as technically (I want better metadata access, thread-safety etc.). I'll use my wrapper from within Zope. There will be some python wrapper around the low-level stuff and I wonder if it makes sense to add pickle-support to that python wrapper. The ODBC api is object-based and exhibits four object types: environment, connection, statement and descriptor objects each of which has a set of methods and properties. Pickle-wise I'm not so concerned about persistence across shutdown/restart cycles (I think it's reasonable to re-create your ODBC environments, connections etc. after restart) but rather about consistency across ZEO-instances. My lack of experience makes me ask here for expert advise. 1) Does the ZEO scenario demand some pickle support, e. g. to use consitent environments/connections etc. across ZEO instances or do I just misunderstand ZEO? 2) If pickle support is a good idea: What scope would you find reasonable? I. e. I can imagine that persistence of environments/descriptors could be useful while persistent connections/statements could cause more trouble than they are worth. As you can see the whole thing isn't very clear to me and so I'd appreciate your comments. TIA, andreas
Ames Andreas (MPA/DF) wrote at 2004-4-22 11:07 +0200:
... The ODBC api is object-based and exhibits four object types: environment, connection, statement and descriptor objects each of which has a set of methods and properties. Pickle-wise I'm not so concerned about persistence across shutdown/restart cycles (I think it's reasonable to re-create your ODBC environments, connections etc. after restart) but rather about consistency across ZEO-instances.
You mean ZEO client instances not ZEO (server) instances, don't you? Why do you think your ODBC objects should be consistent across ZEO clients? I do not think that it is necessary as all your requests your be independent which means all transactions inside a single request which implied that connections need not to be shared.
My lack of experience makes me ask here for expert advise.
1) Does the ZEO scenario demand some pickle support, e. g. to use consitent environments/connections etc. across ZEO instances or do I just misunderstand ZEO?
You probably misunderstand ZEO. ZEO is a storage server that stores persistent objects (as pickles). "Persistent" means "persistence across shutdown/restart". Any object stored by ZEO must be picklable. But, as you are not interested in "persistence across shutdown/restart" for your ODBC objects, there is probably no need to store them in ZEO.
2) If pickle support is a good idea: What scope would you find reasonable? I. e. I can imagine that persistence of environments/descriptors could be useful
Maybe...
while persistent connections/statements could cause more trouble than they are worth.
This is definitely true.
As you can see the whole thing isn't very clear to me and so I'd appreciate your comments.
See how (other) database adapters handle these issues... -- Dieter
participants (2)
-
Ames Andreas (MPA/DF) -
Dieter Maurer