This message was originally directed to Dieter Maurer. Unfortunately, I forwarded it to the Zope list in German. My apologies. Hier the English version: I would like to build a Zope proxy, one of the "special kind". The problem: I have a database which has a free ODBC driver for Windows only, and the client database which I want to access is also living on Windows. Accessing it works fine with Zope's ZODBCDA. The problem is now that our real Zope application must run under Linux, and I would like to use the same database there. So my ide was to have a small Zope running under Windows which attaches to the database, and for the real Linux server, I would write some proxy methods that makes the server think it has direct access to the database. Does anybody know whether something similar already exists? I know the Zope proxy, but I'd like to do a little more, something like a ZPROXYDA, which redirects everything to a different server. Does my approach make sense, or is there a simpler way? I cannot use any paid software since this project must stay completely open-source. Thanks in advance - chris -- Christian Tismer :^) <mailto:tismer@tismer.com> Mission Impossible 5oftware : Have a break! Take a ride on Python's Kaunstr. 26 : *Starship* http://starship.python.net/ 14163 Berlin : PGP key -> http://wwwkeys.pgp.net/ PGP Fingerprint E182 71C7 1A9D 66E9 9D15 D3CC D4D7 93E2 1FAE F6DF where do you want to jump today? http://www.stackless.com/
Hi Chris, There is a project called SQL Relay which I believe has this capability. See http://sourceforge.net/projects/sqlrelay/ (which does tell you to go to http://www.firstworks.com/sqlrelay.html but it's down at the moment for me). - C ----- Original Message ----- From: "Christian Tismer" <tismer@tismer.com> To: <zope@zope.org> Cc: "Dieter Maurer" <dieter@handshake.de> Sent: Friday, July 13, 2001 1:10 PM Subject: [Zope] Zope Proxy Objects
This message was originally directed to Dieter Maurer. Unfortunately, I forwarded it to the Zope list in German. My apologies. Hier the English version:
I would like to build a Zope proxy, one of the "special kind". The problem: I have a database which has a free ODBC driver for Windows only, and the client database which I want to access is also living on Windows. Accessing it works fine with Zope's ZODBCDA.
The problem is now that our real Zope application must run under Linux, and I would like to use the same database there. So my ide was to have a small Zope running under Windows which attaches to the database, and for the real Linux server, I would write some proxy methods that makes the server think it has direct access to the database.
Does anybody know whether something similar already exists? I know the Zope proxy, but I'd like to do a little more, something like a ZPROXYDA, which redirects everything to a different server. Does my approach make sense, or is there a simpler way? I cannot use any paid software since this project must stay completely open-source.
Thanks in advance - chris
-- Christian Tismer :^) <mailto:tismer@tismer.com> Mission Impossible 5oftware : Have a break! Take a ride on Python's Kaunstr. 26 : *Starship* http://starship.python.net/ 14163 Berlin : PGP key -> http://wwwkeys.pgp.net/ PGP Fingerprint E182 71C7 1A9D 66E9 9D15 D3CC D4D7 93E2 1FAE F6DF where do you want to jump today? http://www.stackless.com/
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Chris McDonough wrote:
Hi Chris,
There is a project called SQL Relay which I believe has this capability. See http://sourceforge.net/projects/sqlrelay/ (which does tell you to go to http://www.firstworks.com/sqlrelay.html but it's down at the moment for me).
Oh, the internet is great! Your reply saved me at least two weeks of work. I also couldn't access their homepage, but even the last version from SourceForge(t) seems to be already enough for our needs. many many thanks - chris -- Christian Tismer :^) <mailto:tismer@tismer.com> Mission Impossible 5oftware : Have a break! Take a ride on Python's Kaunstr. 26 : *Starship* http://starship.python.net/ 14163 Berlin : PGP key -> http://wwwkeys.pgp.net/ PGP Fingerprint E182 71C7 1A9D 66E9 9D15 D3CC D4D7 93E2 1FAE F6DF where do you want to jump today? http://www.stackless.com/
Chris McDonough wrote:
Hi Chris,
There is a project called SQL Relay which I believe has this capability. See http://sourceforge.net/projects/sqlrelay/ (which does tell you to go to http://www.firstworks.com/sqlrelay.html but it's down at the moment for me).
Well, on second view, this project is really nice, but does exactly not support the one thing that I need: ODBC on Windows. All sqlrelay servers are written for Unix. Maybe I still should look for a simpler solution. Any ideas? Here the problem again: Use a Windows ODBC database from Zope on Linux. Only OpenSource products can be used. ciao - chris -- Christian Tismer :^) <mailto:tismer@tismer.com> Mission Impossible 5oftware : Have a break! Take a ride on Python's Kaunstr. 26 : *Starship* http://starship.python.net/ 14163 Berlin : PGP key -> http://wwwkeys.pgp.net/ PGP Fingerprint E182 71C7 1A9D 66E9 9D15 D3CC D4D7 93E2 1FAE F6DF where do you want to jump today? http://www.stackless.com/
There is a project called SQL Relay which I believe has this capability. See http://sourceforge.net/projects/sqlrelay/ (which does tell you to go
to
http://www.firstworks.com/sqlrelay.html but it's down at the moment for me).
Well, on second view, this project is really nice, but does exactly not support the one thing that I need: ODBC on Windows. All sqlrelay servers are written for Unix. Maybe I still should look for a simpler solution.
Any ideas? Here the problem again: Use a Windows ODBC database from Zope on Linux. Only OpenSource products can be used.
ciao - chris
A search on the searchable mailing list archive (http://zope.nipltd.com/public/lists) (search for ODBC and Linux) got me this message (and many others) http://zope.nipltd.com/public/lists/zope-archive.nsf/ByKey/ED0437E617CF420E and in addition a howto on http://www.zope.org/Members/lstaffor/ZClientMethod hth Rik
Any ideas? Here the problem again: Use a Windows ODBC database from Zope on Linux. Only OpenSource products can be used.
If you need to see the database connection on your Linux Zope you could try one of the Linux-running ODBC connections to go straight to the server (search this list for links) or perhaps you could use ZEO or some other scheme to mount the Storage of your other Zope to your Linux Zope. Perhaps less complicated would be the XML-RPC Proxy product (http://www.zope.org/Members/dshaw/XMLRPCProxy). Dunno if this can proxy DB connections. If not, perhaps you could create a proxying DB Connection, which would use XML-RPC to call the one on the other server. Otherwise, use xml-rpc or the previously mentioned ZClient to call methods on the other server. --jcc
Howdy, "J. Cameron Cooper" wrote:
Any ideas? Here the problem again: Use a Windows ODBC database from Zope on Linux. Only OpenSource products can be used.
If you need to see the database connection on your Linux Zope you could try one of the Linux-running ODBC connections to go straight to the server (search this list for links) or perhaps you could use ZEO or some other scheme to mount the Storage of your other Zope to your Linux Zope.
Perhaps less complicated would be the XML-RPC Proxy product (http://www.zope.org/Members/dshaw/XMLRPCProxy). Dunno if this can proxy DB connections. If not, perhaps you could create a proxying DB Connection, which would use XML-RPC to call the one on the other server.
I just did it. There is now a product called "ZODBCPDA" which is a proxy for ODBC databases. It works quite fine, lathough I think it can be enhanced. Due to my limited understanding of ZClasses and other Zope specifics, I used the following technique: On windows, there is a Zope application with a top-level folder called ODBCProxy. Inside the folder, there is a couple of external methods. The external methods are sitting in a Python file in the Extensions directory. This file imports the Products.ZODBCDA.db module and publishes all of its functions with a few additional parameters, to identify the instance. Then, I made a copy of ZODBCDA a ZODBCPDA (the proxy) for Linux. It also works from Windows, if you want to connect to a different Win machine. This proxy da redirects all its methods to the target machine which I explained above. It works quite well. Browsing a database is quite slow, since there seem to be many DB calls in the tree object. But retrieving a large set of records is nearly as fast as with a local database. Communication is done with XMLRPC. This is not too efficient, but works well, since usually a whole dataset is returned as one large string, and the XML parsing becomes cheap. There was some trouble with XMLRPC, especially I had to take care of default parameters: None is not supported. Furthermore, XMLRPC can take positional arguments, only. After I realized this, I could quite easily hack around these limitations, and the whole product was functional after a very long session from yesterday to noon today, mostly because I'm not used to Zope. When retrieving data not as string but as a big set of records, things become slow, since XMLRPC is not too efficient, and the representation of many objects via XML is quite large. I will try to improve this by pickling large record sets. Unfortunately, XMLRPC also doesn't handle binary data (which is the most effective pickling approach), so I would have to add an base64 step as well. I think to publish this product in a couple of days as it is. What I'd like to do in the future: - extend it to support just any database - add a binary transfer protocol to XMLRPC which is efficient - make the solution more elegant, without external methods. As a first step to make ODBC usage more similar under Windows and Linux, I will try to make ZODBCDA and ZODBCPDA into one single adaptor with an additional "Proxy" property. This way, the same adaptor can be used, regardless whether the database is local or remote. I would appreciate if someone would give me a hint how to write this in a "cleaner" way, without using a folder and external methods. Thanks to all who provided sugestions and advice. I am becoming a Zope programmer. ciao - chris -- Christian Tismer :^) <mailto:tismer@tismer.com> Mission Impossible 5oftware : Have a break! Take a ride on Python's Kaunstr. 26 : *Starship* http://starship.python.net/ 14163 Berlin : PGP key -> http://wwwkeys.pgp.net/ PGP Fingerprint E182 71C7 1A9D 66E9 9D15 D3CC D4D7 93E2 1FAE F6DF where do you want to jump today? http://www.stackless.com/
participants (4)
-
Chris McDonough -
Christian Tismer -
J. Cameron Cooper -
Rik Hoekstra