Re: [Zope-DB] Zope - Oracle Database Connection
Nachiyappan wrote at 2008-12-1 10:12 +0530: ... i have installed DCOracleda for oracle . but i didn't make connection in zope to oracle ! Zope won't display the connection adapter . Something went wrong with your installation. First of all DCOracleDA needs DCOracle to be installed. DCOracle contains C code which needs to be compiled. Have you carefully followed the installation instructions? If DCOracleDA is in your Products folder, you should see some problem during startup when it does not work correctly. Unfortunately, it is quite difficult to get information about startup problems. Essentially, you need to start Zope in the foreground and it must not run in production mode. Under *nix (and Windows with very recent Zope versions), zopectl fg can be used for this. Watch out Could not import . -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] zope2 rdb and reconnect
[EMAIL PROTECTED] wrote at 2007-12-9 13:42 -0500: Found the problem. I back ported this connector from a zope3 app. For the retry, being raised was rdb.interfaces.Retry, I changed it to raise ZPublisher.Retry, which works for zope2. Maybe there is a better way for zope2, but this works. A better way would be to raise an exception derived from ConflictError. Such an exception would cause ZPublisher to perform the Retry and with a good name for your new exception you would clearly see what happened in case, the exception were repeated. -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] Migration from Windows to Linux. How to do it?
Mongolkhuu Baatar wrote at 2007-7-5 18:26 -0700: I am newbie and sorry for if I ask too simple question. I have designed my Plone site on my localhost (Windows server) machine. Then I need to move my real Zope and Plone server running on the Linux machine. How do I to do this? My both Windows and Linux config is following: Plone port: 80 Zope port: 8080 originally works fine on the each OSs before the migration. I have tried and copied only Data.fs file from Windows to Linux machines related /var/opt/zope/default/var/ folder. Then I have problem with my Plone server running instead Zope of port number 8080. On Linux (and other *nix systems), only processes running as root can bind to ports = 1024 (these are the so called priviledged ports). Almost surely, the Plone setup for Linux therefore uses port 8080 rather than 80. *If* you have root rights on your Linux box, then you can run Zope as root on port 80. You need to change the HTTP port in Zope's configuration file for this. Furthermore, you need to set the user Zope should run with after binding to the port (this is necessary because Zope refuses to run continuously as root -- for security reasons). -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
RE: [Zope-DB] Using dtml-vars in ZSQL methods?
Ken Winter wrote at 2007-6-16 16:03 -0400: ... Exception Type KeyError Exception Value 'id_list' Traceback (innermost last): ... * Module Products.CMFCore.FSPythonScript, line 164, in _exec * Module None, line 4, in people_delete_control FSControllerPythonScript at /DAgroups/people_delete_control used for /DAgroups/portal_factory/People/people.2007-06-16.3625931808 Line 4 * Module Shared.DC.ZRDB.DA, line 481, in __call__ FSZSQLMethod at /DAgroups/people_delete_by_id used for /DAgroups/portal_factory/People/people.2007-06-16.3625931808 * Module DocumentTemplate.DT_String, line 476, in __call__ KeyError: 'id_list' The traceback tells you that it comes from the FSControllerPythonScript people_delete_control and not from a DMTL object (as you have shown us in a previous message). Almost surely, you did not call the Z SQL Method with an id_list keyword parameter there. -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] FileMaker with Zope
David Daniel Estévez Durey wrote at 2007-5-23 10:52 +0100: ... There used to be a ZODBCDA database adapter as Zope product. However, maintenance by zope.com stopped and some interested people took it over. Maybe, you try to search for it. Or you pay the XXX Euro and buy the eGenix mxZODBDA, as suggested by Andreas. Thank you very much for answering, Dieter, but the same I explained to Andreas, money is a very big problem in my case. Then, you need to read very carefully! I sketched an option that does not cost money: Maybe, you try to search for it (ZODBCDA). I do not know how good the new maintenance is or in what state ZODBCDA currently is. You need to invest time (as you cannot invest money) to find this out. -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] Unable to fix a POSKeyError
Ben Lobo wrote at 2007-5-18 17:33 +0100: ... I'm getting a POSKeyError when I try to access a particular file in a Plone site within the ZMI (see error report at http://hobointernet.com/POSKeyError.htm). You replace this file by a new object using an interative Python interpreter: container._setOb(idOfBrokenObject, someNewObject) After that, you can delete the broken object container._delObject(idOfBrokenObject) and commit. -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] Connecting FileMaker with Zope
David Daniel Estévez Durey wrote at 2007-5-3 10:44 +0100: I am trying to connect my FileMaker database with Zope, so I need a Zope Database Adapter for FileMaker. I haven't founded any in the Zope site, in exception of mxODBC Zope DA, but this bridge isn't free. I would be so pleased if anyone could tell me a choice to get it for free! You could use the (commercial!) ZMxOdbcDA from egenix to connect via ODBC. -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] Unicode charset problems dealing with the ZmySQLDA product
Miguel Sánchez Beato wrote at 2007-4-30 12:33 +0200: I'm having problems when I retrieve data from the database because the data is not rendered using the unicode charset when the zope instance is in a vserver (with a Gentoo Linux distribution), so I get weird characters like 'á' instead of the usual ones: 'á' (as they are strored inthe db). Strictly speaking, there is no Unicode charset. Apparently something in your data flow uses the utf-8 charset but your pages do not tell this to the browser. You may try to set an response.setHeader('Content-Type', 'text/html; charset=utf-8). ... Which differences are between the _mysql python module and the MySQLdb library for this purpose? Could it be the configuation of the vserver? How can it be relationed with the unicode problems? Often the database configuration or some environment variable determine the so called client encoding. The client encoding controls which encoding (aka charset) the client expects for unicode strings. There may be differences between your two configurations. -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] Unified DA for Zope 2 using SQLAlchemy?
Andreas Jung wrote at 2007-3-25 17:49 +0200: In the Zope 2 worlds we have dedicated database adapters for different databases. Fortunately the Python world made us a wonderful present called SQLAlchemy that abstracts the different databases. In the Zope world we have some wrappers like z3c.zalchemy and z3c.sqlalchemy... basically they deal with connection handling, mapper handling and integration with the Zope transaction system. Would it make sense to replace all different Zope DAs with a generic DA on top of one of the z3c.* wrappers? I think it would not be too hard to write such a DA...or am I missing something? Thoughts? As I think I know you a bit, I would expect that you also want to deprecate the current support and get rid of it altogether within a year. This would get an even greater desaster than the tried removal of zLOG: huge amounts of applications would stop to work -- and many people would stop to use new Zope releases. Otherwise, I would not object against an *additional* SQLAlchemy based adapter. -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] ZMySQLDA on solaris10
Comunian Alessandro wrote at 2007-2-22 12:30 +0100: ... import _mysql ImportError: ld.so.1: python: fatal: relocation error: file /home/wwhypda/plone/instance_test01/lib/python/_mysql.so: symbol mysql_errno: referenced symbol not found You MySQL-python does not fit with your MySQL version: MySQL-python (that is _mysql.so) expects the MySQL client library to define a symbol mysql_errno and either the client library is not linked at all to _mysql or it does not define the symbol. Check whether you can find a more up to date version of MySQL-python (one that promissed to work with your MySQL version). -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] Please help me about driver adapter
Nguyen Viet Minh Quang wrote at 2007-2-16 12:42 +0700: ... I would like to use pymssql and another one, although I try to install it more times but it's not working. Can you help me to install it? No. I do not have an MS SQL server (I do not like MicroSoft and do not want to pay them any money). All, I can tell you is: look for the installation instructions. Follow them carefully. And an additional note: usually, you need two pieces to let Zope interface with a database: a Python-database interface module and a Zope database adapter. The Zope database adapter is usually a Zope product (Zope's extension mechanism) and needs to be place in instance_home/Products. Further, How can I format the text to get from database, about HTML tag? You use a template (PageTemplate, maybe DTMLMethod) to render the result of you Z SQL method. I would expect that you find examples in the Zope Book (2.7 edition, online on plope.org). -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] Please help me
Nguyen Viet Minh Quang wrote at 2007-2-14 04:52 +0700: ... I would like to develop a new product running on Plone that can get data from relational databases (SQL Server and Oracle). I know also to connect to relational databases to install driver adapter. Yes, I found some driver adapter as ZODBCDA, pymssql, mxODBC (not free) and I fear the best approach is to use the commercial ZmxODBCDA and carefully follow the installation instructions. Before you pay, you can install it on a (limited) trial base. Once, you have successfully managed ZmxODBCDA, you may rething whether you pay the (reasonable, as I have been told) fees for mxODBC or try again with pymssql (for access to the MS SQL server) or cxOracle.(for access to Oracle). The ZODBCDA is no longer reliably maintained (at least as far as I know). -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] Can I change the ZSQL max_rows default value?
Robert-Reinder Nederhoed wrote at 2007-2-6 10:29 +0100: Good day, We use Zope 2.8, still from ZMI. We ran into the 1000 limit several times. Instead of remembering to set it to a higher value, I would like to change the ZSQL max_rows default to 5000. Is it possible to do this? It is also (beside the options already outlined in other replies) possible to use so called monkey patching to modify thee value. For details, search for it. -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] sql query works in database connector but not in ZSQL method
robert rottermann wrote at 2007-1-17 15:42 +0100: ... when I execute this directly in the test window of the database connection, it works fine. when i execute the same line in the test window of a ZSQL Method then I get an error: Error, Products.mxODBCZopeDA.ZopeDA.ReplayTransaction: OperationalError on : ('HYT00', 2014, [unixODBC][MySQL][ODBC 3.51 Driver][mysqld-5.0.26]Commands out of sync; you can't run this command now, 6113) SQL used: Apparently, this error message comes from the mysql server. The most natural way to find out about this error is therefore, to consult the MySQL documentation to learn under what circumstances this error is raised. -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] Zope and MySQL talking on Windows
shahrzad khorrami wrote at 2006-9-30 12:42 +: ... I Installed The Zope MySQL Database Adapter (ZMySQLDA) and The Python MySQL Database Interface (MySQLdb) to Zope's Products directory (Zope/lib/python/Products) , but it didn't work ! In principle, it should work. Have you followed the installation instructions to the point? -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] Zope database connectivity
Maciej Wisniowski wrote at 2006-9-27 17:49 +0200: ... Thanks again for explanations. Seems that I'll change my DA's (DCOracle2 and ZCxOracleDA) to use connection pool like psycopg does. After quick look at their (psycopg) solution I think it is really good and solves (or may solve) few other issues too - like closing all connections with 'Close connection' button (useless with _v_ implementation). Implementing reconnect of broken connection i.e. when database was restarted shouldn't be too difficult too. Pool based connections can be tricky as well: When a DA instance is accessed several times during the same request, it *MUST* use the same connection. Otherwise, you will get the same hazardous behaviour as with _v_ variables being lost, just more often and more reliable... I know that the ZPsycopgDA which comes with psycopg 1.x uses _v_ variables. I do not know whether that of psycopg 2.x uses a connection pool and uses it in the correct way. I only know that the correct connection pool use is tricky... -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] Zope database connectivity
Maciej Wisniowski wrote at 2006-9-25 20:09 +0200: It uses a private ZODB extension to prevent _v_ attributes to be lost mid transaction (which can have nasty, partly non deterministic and very difficult to understand effects) and then calls connect. Does this mean that there is a bug in ZODB? Not strictly speaking in ZODB: The _v_ use for database connections is dangerous (and if you want buggy). It can lead to nasty, apparently non-deterministic effects. You may lose your database connection mid transaction and part of what you think is a transaction (i.e. atomical) can be lost. There are too ways to fix this problem: do not use _v_ attributes to maintain the database connection or extend the ZODB to allow more control over the lifetime of _v_ attributes. In our private copy of Zope, I went the second approach as _v_ attributes are essential for several other things (beside database connections) as well that suffer from the same deficiency. -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] Zope database connectivity
Maciej Wisniowski wrote at 2006-9-24 22:00 +0200: ... Do you have 'connect_' defined elsewhere or it is expected to raise an exception here and just log this? Sure, I have defined connect_. It uses a private ZODB extension to prevent _v_ attributes to be lost mid transaction (which can have nasty, partly non deterministic and very difficult to understand effects) and then calls connect. In the context of our discussion, it is equivalent to connect. -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] KeyError from Shared.DC.DA.DA
FAIRS, Dan, GBM wrote at 2006-9-25 08:58 +0100: ... Here's the salient part of the traceback: File /opt/intranet/cbfmnet/zope_home/Products/Membership/Member.py, line 118, in _getDBValue values = self._getDBValues(attributes=[attribute]) File /opt/intranet/cbfmnet/zope_home/Products/Membership/Member.py, line 96, in _getDBValues , userid=login_elements[1] File /opt/intranet/cbfmnet/zope/lib/python/Shared/DC/ZRDB/DA.py, line 453, in __call__ result=self._cached_result(DB__, (query, self.max_rows_)) File /opt/intranet/cbfmnet/zope/lib/python/Shared/DC/ZRDB/DA.py, line 375, in _cached_result if int(cache[q][0]) == key: KeyError: (execute dbo.EmployeeByNT 'DOMAIN', 'user'\n, 1000, '\nDBConnId: None') The DBConnId is very strange (None rather than DB_Connection). Somehow, the tcache and cache variables are inconsistent. I do not know however, how this can happen. A theoretical possibility would be two different tcache entries tcache[i1] = tcache[i2] = query. Then cache[query] would be deleted for the first entry and the second entry would result in a KeyError. However, such a case should be impossible... You might want to use my CCSQLMethods, which is more efficient anyway (it uses a module level cache rather than a ZODB cache) and definitely will avoid the problem above. -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] Zope database connectivity
Maciej Wisniowski wrote at 2006-9-23 00:27 +0200: You could recode DA's to close the connection at the end of every transaction and reopen them on demand, Seems for me that difference betwen connect on load and connect on demand is in _begin, _finish and __init__ methods of TransactionManager (usually defined in db.py in specific database adapter). The bad behaviour is in standard Zope code: Shared.DC.ZRDB.Connection.Connection.__setstate__ It connects to the database as soon as the instance is loaded from ZODB. My modified code looks like: def __setstate__(self, state): Globals.Persistent.__setstate__(self, state) if self.connection_string: # DM 2005-06-24: what a stupidity to connect on load! # It should be delayed until the connections is really used. # I do not change this here to not break DAs. # DM 2005-06-24: connect_ in order to protect '_v_' attributes #try: self.connect(self.connection_string) try: self.connect_(self.connection_string) except: LOG('Shared.DC.ZRDB.Connection', ERROR, 'Error connecting to relational database.', error=exc_info()) -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] Zope database connectivity
Chris Withers wrote at 2006-9-22 10:48 +0100: Dieter Maurer wrote: M.-A. Lemburg wrote at 2006-9-20 23:00 +0200: ... I'll correct that slightly: Zope DAs usually open the connection as soon as the connection object is loaded into memory, e.g. if you look at the folder contents containing the connection object. In my view, this is a bug in Zope's DA code. However, it really is now as you describe it... Well, you should be a foundation member by now, right? Yes, but my SVN access is not yet working (probably due to a '.' in my Zope user account). -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] Some help about introductory Zope concepts.
Jose Carlos Balderas Alberico wrote at 2006-9-6 08:42 +0200: I've been reading documentation for a month, and although I think I understand what Zope is used for, there's still something I can't embrace, which is Zope's interaction with Apache. Please read the virtual hosting section in the Zope Book (2.7 edition, online on plope.org). ... Another question that bothers me is: what exactly is Zope content? Maybe, http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html may help you? As far as I can tell, it's content that will be server by Zope, but after integrating Zope and Apache, the previous folder, called /htdocs, could be considered Zope content? Apache by itself delivers static content (the content of /htdocs are (mostly) files that are delivered as is). Most Zope content, on the other hand, is not static but dynamically created -- more like CGI scripts than files. -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] Zope, DCOracle2, concurrent transactions, etc.
Please always stay on the list! Michael Mauws wrote at 2006-5-2 14:39 -0600: ... In light of the above, I don't think it's a GIL problem (without having a clue what a GIL actually is) This is the Global Interpreter Lock. It prevents more than a single thread to run Python code at the same time. If C code does not access Python data, it may release the GIL (and than run in parallel with Python code). If it forgets to release the GIL, then no Python code can run. or a DCOracle2 problem. Instead, I think it may be related to Zope's transaction algorithm This is quite unlikely. While Zope cannot concurrently commit more than a single transaction (committing is synchronized on a per storage level) it can run multiple requests while some requests wait on database locks. However, should Oracle delay a commit (due to lock contention), than Zope may not be able to perform further commits. Note, that this would only affect requests that either modify the ZODB or an external database. I'm not sure how threading works in ZOpe, but it appears that my Zope is dealing with page requests sequentially rather than in parallel. That is unusual... As I indicated before, some have suggested that this is solved with ZEO. They err. As well, I found one post that seemed to be suggesting the problem had to do with running Zope behind Apache. It, too, errs. Do either of these explanations make any sense? No. -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] Help request from a non-developer
Christophe Appell wrote at 2006-4-14 17:43 +0200: On 4/13/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Well, this is one reason that I strongly prefer keeping my code on the file system. The availability of change-control software is the other. I happen to like git. Well, we are probably going to do this for files (some forms have associated document files), but I don't see how this would be overly possible for form data, am I off base ? Oh, I would love to implement change control software but I figure let's ask for emergency changes first and then we can look at luxury options. We have a situation similar to yours and handle it in the following way: We classify things into * logic/presentation -- maintained on the file sytem They are synchronized via CVS/SVN * configuration -- maintained in the ZODB, in separated objects, and transfered with ZSyncer from development to production sites. * content -- maintained either in the ZODB or external databases (depending on whether they are poorly or highly structured) They are never transfered from development to production site but occasionally in the other direction. There are a few object types that unfortunately mix configuration and content. Catalogs are a prominent example. We handle them by manually performing the reconfiguration in the production site that we previously tested in the development site. -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] Oracle 9i, Zope 2.9.0 and Windows
[EMAIL PROTECTED] wrote at 2006-4-4 13:08 CES: ... I've found the wiki page: http://zopewiki.org/Oracle and it seems that DOracle2 would be the best thing for my needs (I only n= eed simple inserts and querries, nothing really fancy). But as I see ther= e is no binary for Python 2.4 and Windows. DCOracle2 currently has not maintainer. Maybe, you should look for cx_Oracle (which has an active maintainer). -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] DCOracle2 on AIX5.2 -- issues
[EMAIL PROTECTED] wrote at 2006-3-13 13:32 -0500: ... However, during compilation of cdo2.o, I did encounter these symptoms: cc_r -DNDEBUG -O -I/oracle/product/9.2.0.6/rdbms/demo -I/oracle/product/9.2.0.6/network/public -I/oracle/product/9.2.0.6 /plsql/public -I/oracle/product/9.2.0.6/rdbms/public -I/oracle/product/8.1.7.2/rdbms/demo -I/oracle/product/8.1.7.2/rdbms/public -I/app/sandbox/s625662/installed/include/python2.4 -c src/dco2.c -o build/temp.aix-5.2-2.4/src/dco2.o -brtl -bexpall -DORACLE8i src/dco2.c, line 5004.38: 1506-280 (W) Function argument assignment between types unsigned long* and long* is not allowed. src/dco2.c, line 6066.25: 1506-068 (W) Operation between types short* and unsigned short* is not allowed. src/dco2.c, line 6109.25: 1506-068 (W) Operation between types short* and unsigned short* is not allowed. Obviously, your compiler does not like thing (to be precise: the implicit conversion between short and unsigned short) that the author did not expect to hurt compilers (and which most compilers accept). Your options: * use a different (less strict) compiler * fix the code (such that even your strict compiler feels happy). -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] How I can connect MySQL database?
G E R R I T wrote at 2006-2-9 10:01 +0800: How I can connect MySQL database from my zope web project? Read the relevant chapter in the Zope Book (2.7 editon, online). BTW: Why to you attach an image when you post to a technical newsgroup? -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] external ZODB from Zope interface
gyro funch wrote at 2006-2-2 04:34 -0800: I am a Zope newbie with some Python experience. We have a large amount of scientific data that we are planning to load into several ZODBs. From the Zope interface, how can I access these 'external' databases? To access additional storages, you use Products.ZODBMountPoint.MountedObject.MountedObject instances. Mounting is similar to mounting under *nix. -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] regarding zope database
-bhavana - [EMAIL PROTECTED] wrote at 2006-1-30 10:27 +0700: ... How to communicate with zope database? You use Zope (or scripts using the Zope codebase). the documents that we post in Plone have id, ya? There are lots of ids around. The id used in Plone is not a universal id, but unique only locally in the container. Therefore, you cannot use it to identify and fetch an object. Modern Plone versions (2.1.x) have documents based on AT. There have a universal unique id which can be resolved via the uid_catalog into the object. Someone else already recommended to read the catalog section of the Zope Book (online 2.7 edition). Follow this advice! All persitent objects already have a persitent id. It is not used at application level (as it is meaningless there). The persistent id is the id used by the Zope database. When you know the peristent id of an object, you can load it from ZODB *BUT* it will behave very differently from how you are acoustomed to. That's because you are *NOT* working with raw objects in Zope/Plone but with acquisition wrappers. A ZODB load gives you instead the raw object, which, among other, does not have a location, nor an URL nor a parent -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Fwd: Re: [Zope-DB] database connection]
Martin Krallinger wrote at 2006-1-10 16:57 +0100: thanks for the info. I am actually using zope 2.7 but still I encountered this problem. I think the poster wrote: fixed in Zope 2.7. Maybe, you try 2.8.5 or 2.9? -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] help appreciated [Virus checked]
[EMAIL PROTECTED] wrote at 2006-1-12 15:03 +0100: After creating about 20 ZSQL Methods and polishing them out, I tried some changes in opt/Zope-2.8/lib/python/Shared/DC/ZRDB which worked fine. But then these Objects all appreared like this: Abrechnung (This object from the ZSQLMethods product is broken!) The import of the corresponding class failed -- almost surely because your change broke something... -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] can't Show More than 20 records
Rajesh wrote at 2005-12-29 13:37 +0530: 1. can not show more than 20 records (Roman Page) ... KeyError: 'query' Traceback (innermost last): A bug which should be fixed in quite recent Zope versions -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] Closing idle DCoracle2 Connections?
Germer, Carsten wrote at 2005-10-20 11:16 +0200: ... As we start to use our zope-Ora connection more frequently our database administrator complains that he sees a lot of idle conections. I know theres connection.close() in DCOra2 but does anyone know of a way to autmatically close a DCOra within Zope when idle soandso long? Or any other way to adress such a problem? Modulo bugs, the connection will be closed when the DA object is flushed from the ZODB cache. The ZODB cache is controlled by a maximal size (number of objects) and replaces objects with a least recently used policy. Usually, there is not need for a sophisticated connection management. Just do not create unnecessary DA instances. Modulo bugs, the total number of needed connections is number of DA objects times the number of worker threads. If you see more open connections than this value, you see a bug. Bugs should be fixed and not worked around with more complex software (complex connection management). I know that I wouldn't want the connection being closed from Oracles side as I have read in the mailinglist that DCOracle would still think the connection is open and generate an error. The DA catches OperationalErrors and reopens the connection. It tries to do this transparently (though a bit wrong). -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] psycopg + zope problem
Martin Konicek wrote at 2005-9-7 17:26 +0200: ... * ls /var/lib/zope/lib/python/Products/ZPsycopgDA/ [ ...output ommited...] Provided that Zope looks there for its products, you should see any problems with the import of ZPsycopgDA in your Zope logfile. I cannot tell you where the Zope logfile lies on your installation. -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] Deleting a ZCatalog Object from ZODB
Takahashi, Michael wrote at 2005-7-7 09:27 -0700: But there must be another more efficient way to delete just the single object in the ZCatalog. Indeed: If you look at the catalog API (e.g. in the source or via DocFinder), you will find the uncatalog_object method. -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] Using psycopg directly in Zope Python script
Jørgen Frøjk Kjærsgaard wrote at 2005-7-1 23:28 +0200: I need to be able to access a Postgresql database directly from Zope Python scripts (Z SQL Methods is not an option as the SQL code occurs in modules that must be re-usable in a non-Zope context). ... import psycopg dbcon = psycopg.connect('host=%s dbname=%s user=%s' % ('dbhost', 'dbname', 'username')) You should *NOT* do this because you move outside of Zope's transaction handling. Fetch the connection from the DA. It looks somehow like: db = DA() # low level connection object db._register() # register with Zope's transaction system conn = db.db # this is the psycopg connection Pass the conn into your code. ... When run outside Zope, it opens a connection as expected. When run in Zope, however, I get thrown out - the browser asks me to enter my user name and password again. I get no error message! Cancel the login dialog and you will get the error message :-) Does Zope somehow create a restricted environment PythonScripts are a restricted environment where import is restricted as well as access to attributes. -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] Zope 2.8 and DCOracle2 Stored Procedures
Maciej Wisniowski wrote at 2005-6-23 10:28 +0200: ... Module Products.DCOracle2.SP, line 301, in __call__ TypeError: unbound method _lobConvert() must be called with DB instance as first argument (got list instance instead) On Zope 2.7.x everything is OK. Any ideas what is wrong?? Look at line 301 of DCOracle2/SP.py and check the implicated object and its type. -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] MySQL ZSQL Transactions or Commit in Zope?
Michael Schwartz wrote at 2005-5-15 16:30 -0400: I am trying to find sample code for performing transactions in ZSQL with mysql 4.1. I'd like to do something like this: 1 - Insert record A into USER table 2 - Get auto_increment id for record A 3 - Insert record B into WIDGET table with auto_increment id from previous step But if step 3 fails, I want to undo step 1. Provided you use transactional tables (i.e. you use MySQL in a way that it support transactions), then you only need to abort the Zope transaction (which happens automatically when an exception reached ZPublisher). -- Dieter ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db