Re: [Zope-dev] Trapping Interbase Error Codes
--- Dieter Maurer [EMAIL PROTECTED] wrote: Beverly Dolor writes: I'm currently doing a program on Zope 2.5 using gvibDa as my database. I would like my program to trap Interbase error codes such as (isc_deadlock, isc_lock_conflict), the problem is I'm still at a lost on how to do this. How are these errors shown to you? I do not know Interbase and the corresponding adapters. For Oracle (DCOracle2), Oracle errors are mapped onto a standard exception, but the exception detail contains the Oracle error number. Thus, looking at this number, I would be able to provide error specific information. Dieter Thanks Dieter. Actually gvibDA also maps its errors onto a standard exception. It also provides methods on getting the sql error number, message and message list. Like if my sql query would cause and -803 error, then gvib would return an IntegrityError. But aside from knowing the sql error code, what i really want is to get/trap the Interbase status array codes (isc_deadlock), well if that is possible. And is it only by using External Python scripts that i can do all these error handling, plus the rollback/commit of Zope/database transactions? Any help would be greatly appreciated. __ Do You Yahoo!? Try FREE Yahoo! Mail - the world's greatest free email! http://mail.yahoo.com/ ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: SV: [Zope-dev] Small Alert - Temp Solution - more...
Le Mercredi 6 Mars 2002 22:35, Dieter Maurer a écrit : Jean-Paul Smets writes: I could find out that certain cookie names work, some others do not Works Really strange. Could you use tcpwatch (or another TCP logger) to see whether the Zope response contains the cookie header. If not, this would be a Zope problem we could debug. If so, we have to look elsewhere. Here is the information. 5 cases are shown - Use of Apache + RewriteRule + VHM (CMF auth. cookie is __ac_erp5) - Use of Apache + RewriteRule + VHM (CMF auth. cookie is __ac) - Use of Medusa (CMF auth. cookie is __ac) - Use of Apache + RewriteRule w/o VHM (CMF auth. cookie is __ac_erp5) - Use of Apache + RewriteRule w/o VHM (CMF auth. cookie is __ac) The scenario is - go to http://www.erp5.org/login_form - look at what happens with tcpdump after filing the form and posting it In all cases, this leads to a login success. However, if the auth. cookie is not set (which happens in cases where Apache is used and aut. cookie is __ac), then we are in trouble... You will see that the Set-Cookie is different in the 5 cases My conclusion for now is that something could be wrong with the Apache rewriting process. Regards, JPS. Apache VHM Config VirtualHost erp5.org DocumentRoot /home/jp/public_html/erp5/ ServerName erp5.org ServerAlias www.erp5.org RewriteEngine On RewriteRule ^/(.*) http://localhost:9673/VirtualHostBase/http/www.erp5.org:80/erp5/VirtualHostRoot/$1 [L,P] #RewriteRule ^/(.*) http://localhost:9673/erp5/$1 [L,P] /VirtualHost __ac_erp5 + Apache + VHM 0x 4500 05dc 03cb 4000 3306 bbb5 d42b ed44E.@.3+.D 0x0010 c0a8 0083 0050 9843 a89d dbe3 a856 a8fb.P.C.V.. 0x0020 8010 1b00 1eda 0101 080a 0212 d894 0x0030 01f9 4691 4854 5450 2f31 2e31 2032 3030..F.HTTP/1.1.200 0x0040 204f 4b0d 0a44 6174 653a 2053 6174 2c20.OK..Date:.Sat,. 0x0050 3039 204d 6172 2032 3030 3220 3133 3a3309.Mar.2002.13:3 0x0060 353a 3533 2047 4d54 0d0a 5365 7276 65725:53.GMT..Server 0x0070 3a20 4170 6163 6865 2f31 2e33 2e32 3320:.Apache/1.3.23. 0x0080 2855 6e69 7829 2044 6562 6961 6e20 474e(Unix).Debian.GN 0x0090 552f 4c69 6e75 780d 0a43 6f6e 7465 6e74U/Linux..Content 0x00a0 2d4c 656e 6774 683a 2035 3734 340d 0a43-Length:.5744..C 0x00b0 6f6e 7465 6e74 2d54 7970 653a 2074 6578ontent-Type:.tex 0x00c0 742f 6874 6d6c 0d0a 4574 6167 3a20 0d0at/html..Etag:... 0x00d0 5365 742d 436f 6f6b 6965 3a20 5f5f 6163Set-Cookie:.__ac 0x00e0 5f65 7270 353d 2261 6e41 3659 5852 6862_erp5=anA6YXRhb 0x00f0 4746 7525 3041 223b 2050 6174 683d 2f0dGFu%0A;.Path=/. 0x0100 0a58 2d43 6163 6865 3a20 4d49 5353 2066.X-Cache:.MISS.f 0x0110 726f 6d20 6572 7035 2e6f 7267 0d0a 4b65rom.erp5.org..Ke 0x0120 6570 2d41 6c69 7665 3a20 7469 6d65 6f75ep-Alive:.timeou 0x0130 743d 3135 2c20 6d61 783d 3130 300d 0a43t=15,.max=100..C 0x0140 6f6e 6e65 6374 696f 6e3a 204b 6565 702donnection:.Keep- 0x0150 416c 6976 650d 0a0d 0a20 0a0a 3c68 746dAlive...htm 0x0160 6c3e 0a20 3c68 6561 643e 2020 0a20 203cl..head. 0x0170 7469 746c 653e 4552 5035 2043 6f6d 6d75titleERP5.Commu 0x0180 6e69 7479 3a20 4552 5035 2043 6f6d 6d75nity:.ERP5.Commu 0x0190 6e69 7479 3c2f 7469 746c 653e 0a20 203cnity/title... __ac + Apache + VHM 0x 4500 05dc 4d68 4000 3306 7218 d42b ed44E...Mh@.3.r..+.D 0x0010 c0a8 0083 0050 9845 b6c0 6432 b5b6 2c45.P.E..d2..,E 0x0020 8010 1b00 53bb 0101 080a 0213 29c6S.). 0x0030 01f9 97c1 4854 5450 2f31 2e31 2032 3030HTTP/1.1.200 0x0040 204f 4b0d 0a44 6174 653a 2053 6174 2c20.OK..Date:.Sat,. 0x0050 3039 204d 6172 2032 3030 3220 3133 3a3309.Mar.2002.13:3 0x0060 393a 3231 2047 4d54 0d0a 5365 7276 65729:21.GMT..Server 0x0070 3a20 4170 6163 6865 2f31 2e33 2e32 3320:.Apache/1.3.23. 0x0080 2855 6e69 7829 2044 6562 6961 6e20 474e(Unix).Debian.GN 0x0090 552f 4c69 6e75 780d 0a43 6f6e 7465 6e74U/Linux..Content 0x00a0 2d4c 656e 6774 683a 2035 3734 340d 0a43-Length:.5744..C 0x00b0 6f6e 7465 6e74 2d54 7970 653a 2074 6578ontent-Type:.tex 0x00c0 742f 6874 6d6c 0d0a 4574 6167 3a20 0d0at/html..Etag:... 0x00d0 5365 742d 436f 6f6b 6965 3a20 5f5f 6163Set-Cookie:.__ac 0x00e0 5f6e 616d 653d 226a 7022 3b20 4578 7069_name=jp;.Expi 0x00f0 7265 733d 5375 6e2c 2030 3920 4d61 7220res=Sun,.09.Mar. 0x0100 3230 3033 2031 333a 3339 3a32 3220 474d2003.13:39:22.GM 0x0110 543b 2050 6174 683d 2f0d 0a58 2d43 6163T;.Path=/..X-Cac 0x0120 6865 3a20 4d49 5353 2066 726f 6d20 6572he:.MISS.from.er 0x0130 7035 2e6f 7267 0d0a 4b65 6570 2d41 6c69
Re: [Zope-dev] Manual object-to-relational persistency framework
Thanks Dieter, I think ZPatterns is certainly worth a look. It allows you to slice-and-dice what you want to store in ZODB or RDBMS. The best part is you can develop totally in ZODB, then migrate to RDB a bit at a time (if you like) without changing your app, or your data classes. We have multiple instance of the same app mixing up ZODB, RDB, LDAP etc.. since all the wiring of data-objects is done in configurable data managers on an instance by instance basis. http://www.zope.org/Members/pje/ZPatterns for Zope-2.[45].x see also: http://www.cat-box.net/steve/TransactionAgents Three chapters of our book (www.zopeonarope.com) are devoted to implementing ZPatterns based apps. good luck! -steve On Friday, March 8, 2002, at 02:56 PM, Dieter Maurer wrote: Bjorn Stabell writes: I'm trying to use Zope without storing everything in ZODB while still having the perception of an object-oriented database. I want to control the object-to-relational mapping layer, but would like the loading and saving of objects to be automatic. Is there some way to do that using Zope? Maybe ZPattern? Dieter ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope ) ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: SV: [Zope-dev] Small Alert - Probably Apache / mod-rewrite
Hi, I did a few more tests. Apparently, this cookie issue - happens in proxy mode - does not happen in CGI mode Of course, it is required to delete all cookies stored in the browser once the __ac cookie has been successfully set in CGI mode I have enclose an excerpt of my Apache config which shows various tests. JPS. VirtualHost erp5.org DocumentRoot /home/jp/public_html/erp5/ ServerName erp5.org ServerAlias www.erp5.org #ProxyPass / http://localhost:9673/VirtualHostBase/http/www.erp5.org:80/erp5/VirtualHostRoot/ RewriteEngine on RewriteCond %{HTTP:Authorization} ^(.*) #RewriteRule ^/(.*) http://localhost:9673/VirtualHostBase/http/www.erp5.org:80/erp5/VirtualHostRoot/$1 [L,P] #RewriteRule ^/(.*) http://localhost:9673/erp5/$1 [L,P] #RewriteRule ^/(.*) http://localhost:9673/VirtualHostBase/http/www.erp5.org:80/erp5/VirtualHostRoot/$1 [L,P] RewriteRule ^/(.*) /usr/lib/cgi-bin/Zope/VirtualHostBase/http/www.erp5.org:80/erp5/VirtualHostRoot/$1 [e=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l] /VirtualHost -- Jean-Paul Smets-Solanes [EMAIL PROTECTED] - Nexedi (CEO) GPG Fingerprint: 40FF FA78 75AA 680D 8BB4 EEF9 539A 79CC CB8E 5F01 ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
SV: SV: [Zope-dev] Small Alert - Temp Solution - more...
You will see that the Set-Cookie is different in the 5 cases My conclusion for now is that something could be wrong with the Apache rewriting process. Nope, cause I'm running Roxen.. and have the same behaviour. /Magnus ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Trapping Interbase Error Codes
On 8 Mar 2002 at 20:58, Dieter Maurer wrote: Beverly Dolor writes: I'm currently doing a program on Zope 2.5 using gvibDa as my database. I would like my program to trap Interbase error codes such as (isc_deadlock, isc_lock_conflict), the problem is I'm still at a lost on how to do this. How are these errors shown to you? I do not know Interbase and the corresponding adapters. For Oracle (DCOracle2), Oracle errors are mapped onto a standard exception, but the exception detail contains the Oracle error number. Thus, looking at this number, I would be able to provide error specific information. Checking specific error codes from within Zope is a PITA because of access control on the Exception object. You'll need to modify gvibExceptions.py, add doc strings to def getSqlCode(self) and other methods.. And probably add __roles__=None __allow_access_to_unprotected_subobjects__=1 hack lines to Exception class defs. OTH, if you use an external method to process the gvib request, or create an external method that can extract the sqlCode for you.. then you wouldn't need these mods. def getSqlCode(exceptionObject): Return the sqlcode return exceptionObject.getSqlCode() Then when you get an exception, pass the exception object to the external method to get the sqlcode. Brad Clements,[EMAIL PROTECTED] (315)268-1000 http://www.murkworks.com (315)268-9812 Fax AOL-IM: BKClements ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Unauthorized users can writelock helpfiles in /Control_Panel/Products
There is no way to fix this? What other problems are there with the help system? Not that I can think of. Other problems with the help system are presentation, mostly. Would it somehow be possible to make the helpsystem ignore versions? No, unfortunately. It uses the Catalog, which is based on ZODB, and it puts a Catalog instance into the main FileStorage, which is undoing and versioning. It then proceeds to do writes to the database when it appears that all you're doing is reading a pre-existing page. If you're in a version at the time, a set of objects will be written into the Catalog and into other places in instance space that have version. This is a bad pattern, and the only way to fix it is to prevent it from happening, which requires some helpsystem architectural changes that amount (IMHO) to a rewrite. - C -- Chris McDonoughZope Corporation http://www.zope.org http://www.zope.com Killing hundreds of birds with thousands of stones ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Unauthorized users can writelock helpfiles in /Control_Panel/Products
Note that I volunteered to rewrite the help system in the Zope 2.6 plan. Chris McDonough wrote: There is no way to fix this? What other problems are there with the help system? Not that I can think of. Other problems with the help system are presentation, mostly. Would it somehow be possible to make the helpsystem ignore versions? No, unfortunately. It uses the Catalog, which is based on ZODB, and it puts a Catalog instance into the main FileStorage, which is undoing and versioning. It then proceeds to do writes to the database when it appears that all you're doing is reading a pre-existing page. If you're in a version at the time, a set of objects will be written into the Catalog and into other places in instance space that have version. This is a bad pattern, and the only way to fix it is to prevent it from happening, which requires some helpsystem architectural changes that amount (IMHO) to a rewrite. - C -- Chris McDonoughZope Corporation http://www.zope.org http://www.zope.com Killing hundreds of birds with thousands of stones ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: SV: [Zope-dev] Small Alert - Temp Solution - more...
Jean-Paul Smets writes: ... TCPWatch dumps demonstrating cookie problem for __ac cookie ... When I read the dumps correct then *ALL* Apache + __ac dumps lack the __ac cookie whether or nor VHM is used. Thus, I would say, VHM is out of suspicion. Now, Apache + Zope via mod_proxy is Zope via Medusa. I do not expect Zope to behave differently when Apache is there. As Zope (+ medusa) alone has the __ac cookie, this may indicate an Apache problem. You can verify that by using TCPWatch between Apache und Zope (rather than between your browser and Apache). Dieter ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] SQL compare to form value -HELP-
I am trying to test whether or not 3 SQL fields are equal to a form field. I am doing this within an SQL method. (I am trying to learn zope and Mysql at the sam time) How does one do this? Here is where I am going with this so far: I have these listed as arguments: Breeds Breed1 Breed2 Breed3 SELECT * from Ranch WHERE Breeds = dtml-sqltest name=Breed1 type=string OR Breeds = dtml-sqltest name=Breed2 type=string or Breeds = dtml-sqltest name=Breed3 type=string Breeds is the name of the form input and I want to test and see if it equals any one of the 3 fields Breed1, Breed2, or Breed3 and return all of the row if there is a match. -- Sean ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )