From dipakbhandari@hotmail.com Sat Mar 2 23:11:13 2002 From: dipakbhandari@hotmail.com (dipak bhandari) Date: Sat, 02 Mar 2002 23:11:13 Subject: [Zope-DB] RE: Help : Uploading images in Zope Message-ID:


I would like to know a way to upload images in Zope from the client side via a form and insert it in a table in Gadfly and MySQL. Moreover, how do we restrict the size (in KB) of the uploaded images. Please get back to me ASAP.

Thanks,

Dipak Bhandari

Master of IT student, Bond University,Australia




MSN Photos is the easiest way to share and print your photos: Click Here
From joel@joelburton.com Mon Mar 4 21:19:36 2002 From: joel@joelburton.com (Joel Burton) Date: Mon, 4 Mar 2002 16:19:36 -0500 (EST) Subject: [Zope-DB] Re: Uploading Images in Zope from Client Side In-Reply-To: Message-ID: On Wed, 27 Feb 2002, dipak bhandari wrote: > > I would like to know a way to upload images in Zope from the client side via a form and insert it in a table in > Gadfly and MySQL. Moreover, how do we restrict the size (in KB) of the uploaded images. Please get back to me > ASAP. MySQL can store binary data in a table, so storage an image there would be no problem. Read the Zope HOWTOs on retrieving files that are uploaded from forms (lots of FAQs on this in the zope@zope.org ML). Then, just use a ZSQLMethod to insert that data into a table. No idea about Gadfly; it's mostly there to play with. -- Joel BURTON | joel@joelburton.com | joelburton.com | aim: wjoelburton Independent Knowledge Management Consultant From ruger@acsnv.com Mon Mar 4 21:41:09 2002 From: ruger@acsnv.com (ruger@acsnv.com) Date: Mon, 4 Mar 2002 13:41:09 -0800 Subject: [Zope-DB] automating db connections Message-ID: <02030413410900.21317@rick.tsctr.com> I need to figure out how to close and re-open a database connection from within Zope. What would I call to do that? I can use Xron to have it run at a certain time, but I can figure out what to run. The problem is that my ODBC connection freezes up every night. I've re-installed and played with it, but it still does the same thing. The connection on the server shows that it's still open, but I can't run any queries against it. I was hoping to write something that would close it and re-open it at a set time every night. TIA Rick From dieter@handshake.de Tue Mar 5 21:44:57 2002 From: dieter@handshake.de (Dieter Maurer) Date: Tue, 5 Mar 2002 22:44:57 +0100 Subject: [Zope-DB] automating db connections In-Reply-To: <02030413410900.21317@rick.tsctr.com> References: <02030413410900.21317@rick.tsctr.com> Message-ID: <15493.15449.794.270373@linux.local> D.Rick Anderson writes: > I need to figure out how to close and re-open a database connection from > within Zope. This calls for a standard answer: You can do it from Zope Management Screen. Look at the source of the defining dtml page. Alternatively, you can use my "DocFinder" product and look at the methods provided by a Database Connection. You may guess which methods do what you need. Dieter From kevin@innovativelinux.com Wed Mar 6 05:32:11 2002 From: kevin@innovativelinux.com (Kevin Taylor) Date: 05 Mar 2002 23:32:11 -0600 Subject: [Zope-DB] DCOracle2: Invalid Connection String Message-ID: <1015392734.23027.12.camel@marauder> I am running into a problem with DCOracle2, when trying to connect to a local Oracle 8.1.7 database. From the Management interface, I can go to my Oracle_database_connection object and attempt to update the connection string to zope/zope2 (to match my test database). This always returns Invalid Connection String. I am running: SuSE 7.3 with their build of Zope 2.4.1 Oracle 8.1.7 on the same machine I did update the zope start script to include LD_LIBRARY_PATH and ORACLE_HOME variables. I also tried going to a console, setting these manually and running the z2.py directly. I referred to previous posts regarding the same problem, and am including pertinent information related to those posts as well: My sqlnet.ora: # SQLNET.ORA Network Configuration File: /opt/oracle/product/817/network/admin/sqlnet.ora # Generated by Oracle configuration tools. NAMES.DEFAULT_DOMAIN = battletech.org NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME) My tnsnames.ora: # TNSNAMES.ORA Network Configuration File: /opt/oracle/product/817/network/admin/tnsnames.ora # Generated by Oracle configuration tools. EXTPROC_CONNECTION_DATA.BATTLETECH.ORG = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC)) ) (CONNECT_DATA = (SID = PLSExtProc) (PRESENTATION = RO) ) ) MARAUDER.BATTLETECH.ORG = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = marauder)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = marauder) ) ) INST1_HTTP.BATTLETECH.ORG = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = marauder)(PORT = 1521)) ) (CONNECT_DATA = (SERVER = SHARED) (SERVICE_NAME = marauder) (PRESENTATION = http://admin) ) ) Contents of my sqlnet.log: *********************************************************************** Fatal NI connect error 12546, connecting to: (DESCRIPTION=(ADDRESS=(PROTOCOL=beq)(PROGRAM=/opt/oracle/product/817/bin/oracle)(ARGV0=oraclemydb)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))')(DETACH=NO))(CONNECT_DATA=(CID=(PROGRAM=)(HOST=marauder)(USER=nobody)))) VERSION INFORMATION: TNS for Linux: Version 8.1.7.0.0 - Development Oracle Bequeath NT Protocol Adapter for Linux: Version 8.1.7.0.0 - Development Time: 05-MAR-2002 22:37:46 Tracing not turned on. Tns error struct: nr err code: 0 ns main err code: 12546 TNS-12546: Message 12546 not found; No message file for product=network, facility=TNS ns secondary err code: 12560 nt main err code: 516 TNS-00516: Message 516 not found; No message file for product=network, facility=TNS nt secondary err code: 13 nt OS err code: 0 *********************************************************************** (this repeats several times) Can anyone give me an idea of how to solve the above issues? If you have some pertinent info, could you also cc my e-mail account (kevin@innovativelinux.com), as I only receive daily batches from this mailing list. -- Kevin Taylor ----------------------------- Innovative Linux Solutions kevin@innovativelinux.com Phone: (972) 437-0343 Fax: (972) 422-8678 Cell: (214) 763-9507 280 E. FM 544 Suite 104-113 Murphy, TX 75094-4021 ----------------------------- From matt@zope.com Wed Mar 6 13:18:55 2002 From: matt@zope.com (Matthew T. Kromer) Date: Wed, 6 Mar 2002 08:18:55 -0500 Subject: [Zope-DB] DCOracle2: Invalid Connection String In-Reply-To: <1015392734.23027.12.camel@marauder> Message-ID: OK, TNS 12546 means (and I looked it up in the error guide) that you don't have read access to the Oracle Home from Zope. Check the permissions on the directories, and make sure the Zope userid has sufficient access rights to read into the ORACLE_HOME areas. On Wednesday, March 6, 2002, at 12:32 AM, Kevin Taylor wrote: > I am running into a problem with DCOracle2, when trying to connect to a > local Oracle 8.1.7 database. From the Management interface, I can go to > my Oracle_database_connection object and attempt to update the > connection string to zope/zope2 (to match my test database). This > always returns Invalid Connection String. > > I am running: > SuSE 7.3 with their build of Zope 2.4.1 > Oracle 8.1.7 on the same machine > > I did update the zope start script to include LD_LIBRARY_PATH and > ORACLE_HOME variables. I also tried going to a console, setting these > manually and running the z2.py directly. > > I referred to previous posts regarding the same problem, and am > including pertinent information related to those posts as well: > > > > My sqlnet.ora: > > # SQLNET.ORA Network Configuration File: > /opt/oracle/product/817/network/admin/sqlnet.ora > # Generated by Oracle configuration tools. > > NAMES.DEFAULT_DOMAIN = battletech.org > > NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME) > > > > My tnsnames.ora: > > # TNSNAMES.ORA Network Configuration File: > /opt/oracle/product/817/network/admin/tnsnames.ora > # Generated by Oracle configuration tools. > > EXTPROC_CONNECTION_DATA.BATTLETECH.ORG = > (DESCRIPTION = > (ADDRESS_LIST = > (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC)) > ) > (CONNECT_DATA = > (SID = PLSExtProc) > (PRESENTATION = RO) > ) > ) > > MARAUDER.BATTLETECH.ORG = > (DESCRIPTION = > (ADDRESS_LIST = > (ADDRESS = (PROTOCOL = TCP)(HOST = marauder)(PORT = 1521)) > ) > (CONNECT_DATA = > (SERVICE_NAME = marauder) > ) > ) > > INST1_HTTP.BATTLETECH.ORG = > (DESCRIPTION = > (ADDRESS_LIST = > (ADDRESS = (PROTOCOL = TCP)(HOST = marauder)(PORT = 1521)) > ) > (CONNECT_DATA = > (SERVER = SHARED) > (SERVICE_NAME = marauder) > (PRESENTATION = http://admin) > ) > ) > > > Contents of my sqlnet.log: > > > *********************************************************************** > Fatal NI connect error 12546, connecting to: > > (DESCRIPTION=(ADDRESS=(PROTOCOL=beq)(PROGRAM=/opt/oracle/product/817/bin/ > oracle)(ARGV0=oraclemydb)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS= > (PROTOCOL=beq)))')(DETACH=NO))(CONNECT_DATA=(CID=(PROGRAM=)(HOST=marauder) > (USER=nobody)))) > > VERSION INFORMATION: > TNS for Linux: Version 8.1.7.0.0 - Development > Oracle Bequeath NT Protocol Adapter for Linux: Version 8.1.7.0.0 > - Development > Time: 05-MAR-2002 22:37:46 > Tracing not turned on. > Tns error struct: > nr err code: 0 > ns main err code: 12546 > TNS-12546: Message 12546 not found; No message file for > product=network, facility=TNS > ns secondary err code: 12560 > nt main err code: 516 > TNS-00516: Message 516 not found; No message file for > product=network, facility=TNS > nt secondary err code: 13 > nt OS err code: 0 > > > *********************************************************************** > > (this repeats several times) > > > > > > > Can anyone give me an idea of how to solve the above issues? If you > have some pertinent info, could you also cc my e-mail account > (kevin@innovativelinux.com), as I only receive daily batches from this > mailing list. > > -- > > Kevin Taylor > > ----------------------------- > Innovative Linux Solutions > > kevin@innovativelinux.com > > Phone: (972) 437-0343 > Fax: (972) 422-8678 > Cell: (214) 763-9507 > > 280 E. FM 544 > Suite 104-113 > Murphy, TX 75094-4021 > ----------------------------- > > > _______________________________________________ > Zope-DB mailing list > Zope-DB@zope.org > http://lists.zope.org/mailman/listinfo/zope-db From joel@joelburton.com Wed Mar 6 17:02:27 2002 From: joel@joelburton.com (Joel Burton) Date: Wed, 6 Mar 2002 12:02:27 -0500 (EST) Subject: [Zope-DB] automating db connections In-Reply-To: <15493.15449.794.270373@linux.local> Message-ID: On Tue, 5 Mar 2002, Dieter Maurer wrote: > D.Rick Anderson writes: > > I need to figure out how to close and re-open a database connection from > > within Zope. > This calls for a standard answer: > > You can do it from Zope Management Screen. > Look at the source of the defining dtml page. Yep. Always a good idea. Look at the source for the frame where the button to "close connection" appears, and you can see that this is manage_close_connection. To open, it's manage_open_connection. ZSQL stuf can be a little tricky to find by source code since there's a few levels of abstraction going on, but this methods are defined in Shared/DC/ZRDB/Connection.py You could use xron or just plain ordinary cron, having cron use lynx/wget/curl/python-urllib/whatever to get the pages /folder/db_item/manage_close_connection then manage_open_connection -- Joel BURTON | joel@joelburton.com | joelburton.com | aim: wjoelburton Independent Knowledge Management Consultant From Tomas.Holenda@openone.cz Wed Mar 6 17:52:11 2002 From: Tomas.Holenda@openone.cz (Tomas Holenda) Date: Wed, 06 Mar 2002 18:52:11 +0100 Subject: [Zope-DB] Getting 500's and 503's from Zope + Firebird Message-ID: <3C86574B.1080709@openone.cz> Hi, I have combination Apache, pcgi, Zope 2.5, gvibDA 0.9.7., Firebird 1.0.0 RC2 On pages using database, I often get 500 Internal Server Error and 50 Service Unavailable. I tested it with torture.pl and the results vary. Sometimes it's 100%OK, sometimes 75% errors. Pages without database use are allways OK. Do you have any idea, where can be the problem? Thanks Tomas. From ruger@acsnv.com Wed Mar 6 18:30:58 2002 From: ruger@acsnv.com (ruger@acsnv.com) Date: Wed, 6 Mar 2002 10:30:58 -0800 Subject: [Zope-DB] automating db connections In-Reply-To: <15493.15449.794.270373@linux.local> References: <02030413410900.21317@rick.tsctr.com> <15493.15449.794.270373@linux.local> Message-ID: <02030610305802.01237@rick.tsctr.com> Your DocFinder product is awesome. I've got it working. Thanks again Dieter, Rick On Tuesday 05 March 2002 01:44 pm, you wrote: > D.Rick Anderson writes: > > I need to figure out how to close and re-open a database connection from > > within Zope. > > This calls for a standard answer: > > You can do it from Zope Management Screen. > Look at the source of the defining dtml page. > > Alternatively, you can use my "DocFinder" product > > > > and look at the methods provided by a Database Connection. > You may guess which methods do what you need. > > > Dieter From joel@joelburton.com Thu Mar 7 18:15:19 2002 From: joel@joelburton.com (Joel Burton) Date: Thu, 7 Mar 2002 13:15:19 -0500 (EST) Subject: [Zope-DB] Getting 500's and 503's from Zope + Firebird In-Reply-To: <3C86574B.1080709@openone.cz> Message-ID: On Wed, 6 Mar 2002, Tomas Holenda wrote: > Hi, > I have combination Apache, pcgi, Zope 2.5, gvibDA 0.9.7., Firebird 1.0.0 RC2 > On pages using database, I often get 500 Internal Server Error and 50 > Service Unavailable. > I tested it with torture.pl and the results vary. Sometimes it's 100%OK, > sometimes 75% errors. > > Pages without database use are allways OK. > > Do you have any idea, where can be the problem? > > Thanks > Tomas. Haven't used gvibDA (or any Interbase DA for Zope), so can't answer any specific questions. But: what do your tracebacks say for the 500 Internal Server Error? -- Joel BURTON | joel@joelburton.com | joelburton.com | aim: wjoelburton Independent Knowledge Management Consultant From dieter@handshake.de Thu Mar 7 20:09:10 2002 From: dieter@handshake.de (Dieter Maurer) Date: Thu, 7 Mar 2002 21:09:10 +0100 Subject: [Zope-DB] Getting 500's and 503's from Zope + Firebird In-Reply-To: <3C86574B.1080709@openone.cz> References: <3C86574B.1080709@openone.cz> Message-ID: <15495.51430.679620.233640@linux.local> Tomas Holenda writes: > I have combination Apache, pcgi, Zope 2.5, gvibDA 0.9.7., Firebird 1.0.0 RC2 > On pages using database, I often get 500 Internal Server Error and 50 > Service Unavailable. Who generates these error pages? When its Zope, they should contain tracebacks (maybe in HTML comments. This means, you see them only when looking at the HTML source). When its Apache, then Zope probably died (or you have an unfortunate error page defined for Apache rather than letting the original page through). Turn on Zope logging (search the mailing list archives for "STUPID_LOG_FILE") and see what's written in the log file. When Zope dies, look at the Zope stability document, recently announced on the list. Dieter From Tomas.Holenda@openone.cz Fri Mar 8 16:09:49 2002 From: Tomas.Holenda@openone.cz (Tomas Holenda) Date: Fri, 08 Mar 2002 17:09:49 +0100 Subject: [Zope-DB] Getting 500's and 503's from Zope + Firebird Message-ID: <3C88E24D.9070106@openone.cz> I tried multithreaded python gvib stress test found on http://clientes.netvisao.pt/luiforra/ib/stress.py and it crashes with Program received signal SIGSEGV, Segmentation fault. 0x401f943f in THD_restore_specific () from /usr/lib/libgds.so (output from gdb). From dieter@handshake.de Fri Mar 8 20:46:21 2002 From: dieter@handshake.de (Dieter Maurer) Date: Fri, 8 Mar 2002 21:46:21 +0100 Subject: [Zope-DB] Getting 500's and 503's from Zope + Firebird In-Reply-To: References: <3C86574B.1080709@openone.cz> <15495.51430.679620.233640@linux.local> Message-ID: <15497.8989.105247.157217@linux.local> tomash <""Tomas Holenda > writes: > >Turn on Zope logging (search the mailing list archives for "STUPID_LOG_FILE") > >and see what's written in the log file. > >When Zope dies, look at the Zope stability document, recently announced > >on the list. > > > > STUPID_LOG_FILE says > > ERROR(200) zdaemon zdaemon: Thu Mar 7 22:17:31 2002: Aiieee! 15103 > exited with error code: 11 That's a segmentation violation. If you not yet have: upgrade to Python 2.1.2 and Zope 2.5.1. Dieter From tomas.holenda@openone.cz Sat Mar 9 12:12:17 2002 From: tomas.holenda@openone.cz (tomash) Date: Sat, 09 Mar 2002 13:12:17 +0100 Subject: [Zope-DB] Getting 500's and 503's from Zope + Firebird References: <3C86574B.1080709@openone.cz> <15495.51430.679620.233640@linux.local> <15497.8989.105247.157217@linux.local> Message-ID: <3C89FC21.7020905@openone.cz> > > >> > > ERROR(200) zdaemon zdaemon: Thu Mar 7 22:17:31 2002: Aiieee! 15103 > > exited with error code: 11 >That's a segmentation violation. > >If you not yet have: upgrade to Python 2.1.2 and Zope 2.5.1. > I have Python 2.1.2 and gvibDA 0.9.6 with manually changed Py_ to PyMem_ in memory alocation functions. I think that Zope version doesn't matter (I have 2.5.0), because the python crashes itself with gvib stress test. Interbase version is Firebird 1.0 RC2. > From jmartinez@emediamillworks.com Mon Mar 11 19:56:09 2002 From: jmartinez@emediamillworks.com (Jorge O. Martinez) Date: Mon, 11 Mar 2002 14:56:09 -0500 Subject: [Zope-DB] Oracle 8.1.7.1 on Solaris 8 Message-ID: <3C8D0BD9.1050604@emediamillworks.com> Hi all: We are evaluating a good CMS for a rather simple application, but with a lot of data, and which will have to be updated by regular users on a daily basis. Zope seems to fit the bill. However, I am wondering if it can run on a Sun box running Solaris 8, and using Oracle 8.1.7.1 in the backend. Anyone outthere has any first hand experience deploying zope under this env? Thanks! Jorge M. -- Jorge O. Martinez MIS Senior Associate eMediaMillWorks 1100 Mercantile Lane, Suite 119 Largo, MD 20774 E-mail => jmartinez@eMediaMillWorks.com Phone => (301)883-2482 ext. 105 Fax => (301)883-9754 From paul.browning@bristol.ac.uk Tue Mar 12 16:46:02 2002 From: paul.browning@bristol.ac.uk (Paul Browning) Date: Tue, 12 Mar 2002 16:46:02 -0000 Subject: [Zope-DB] Oracle 8.1.7.1 on Solaris 8 In-Reply-To: <3C8D0BD9.1050604@emediamillworks.com> References: <3C8D0BD9.1050604@emediamillworks.com> Message-ID: <36334315.1015951562@[192.168.1.2]> --On 11 March 2002 14:56 -0500 "Jorge O. Martinez" wrote: > Hi all: > > We are evaluating a good CMS for a rather simple application, but with a > lot of data, and which will have to be updated by regular users on a > daily basis. Zope seems to fit the bill. > > However, I am wondering if it can run on a Sun box running Solaris 8, and > using Oracle 8.1.7.1 in the backend. > > Anyone outthere has any first hand experience deploying zope under this > env? Yes. It can suck. Search the main zope list archives on "Solaris threading". I hope shortly to be in a position to share the results of an investigation into this area. Paul -- The Library, Tyndall Avenue, Univ. of Bristol, Bristol, BS8 1TJ, UK E-mail: paul.browning@bristol.ac.uk URL: http://www.bris.ac.uk/ From jmartinez@eMediaMillWorks.com Tue Mar 12 21:18:14 2002 From: jmartinez@eMediaMillWorks.com (Jorge O. Martinez) Date: Tue, 12 Mar 2002 16:18:14 -0500 Subject: [Zope-DB] Oracle 8.1.7.1 on Solaris 8 References: <3C8D0BD9.1050604@emediamillworks.com> <36334315.1015951562@[192.168.1.2]> Message-ID: <3C8E7096.2050700@emediamillworks.com> Paul: Really? That does not sound good. Could you get it to work though? Jorge M. Paul Browning wrote: > > > --On 11 March 2002 14:56 -0500 "Jorge O. Martinez" > wrote: > >> Hi all: >> >> We are evaluating a good CMS for a rather simple application, but with a >> lot of data, and which will have to be updated by regular users on a >> daily basis. Zope seems to fit the bill. >> >> However, I am wondering if it can run on a Sun box running Solaris 8, and >> using Oracle 8.1.7.1 in the backend. >> >> Anyone outthere has any first hand experience deploying zope under this >> env? > > > Yes. It can suck. Search the main zope list archives on "Solaris > threading". I hope > shortly to be in a position to share the results of an investigation into > this area. > > Paul > > -- > The Library, Tyndall Avenue, Univ. of Bristol, Bristol, BS8 1TJ, UK > E-mail: paul.browning@bristol.ac.uk URL: http://www.bris.ac.uk/ -- Jorge O. Martinez MIS Senior Associate eMediaMillWorks 1100 Mercantile Lane, Suite 119 Largo, MD 20774 E-mail => jmartinez@eMediaMillWorks.com Phone => (301)883-2482 ext. 105 Fax => (301)883-9754 From =?iso-8859-1?Q?Dario_Lopez-K=E4sten?= Tue Mar 12 21:28:59 2002 From: =?iso-8859-1?Q?Dario_Lopez-K=E4sten?= (=?iso-8859-1?Q?Dario_Lopez-K=E4sten?=) Date: Tue, 12 Mar 2002 22:28:59 +0100 Subject: [Zope-DB] Oracle 8.1.7.1 on Solaris 8 References: <3C8D0BD9.1050604@emediamillworks.com> <36334315.1015951562@[192.168.1.2]> <3C8E7096.2050700@emediamillworks.com> Message-ID: <053001c1ca0c$ef234950$4bdf1081@ita.chalmers.se> ----- Original Message ----- From: "Jorge O. Martinez" To: "Paul Browning" Cc: Sent: Tuesday, March 12, 2002 10:18 PM Subject: Re: [Zope-DB] Oracle 8.1.7.1 on Solaris 8 > Paul: > > Really? That does not sound good. Could you get it to work though? > > Jorge M. Let me put it this way: it might be better now, but back then, because of the problems that where, it force me to become the proud owner of a 2 CPU dell rack.-mounted thing, running redhat. Until then, we where Solaris only for servers. It really sucked on a Enterprise 450 with 1 or 2 gigs of ram and 4 CPUs. Python problems, threading problems zope instabilities... etc etc. Some of these issues have been resovled by pther snow, but zope the threading problem is still there AFAIK. Zope really pushes Python to it's limits and on solaris it seems to just not work well... Sorry to be so negative. /dario - -------------------------------------------------------------------- Dario Lopez-Kästen Systems Developer Chalmers Univ. of Technology dario@ita.chalmers.se ICQ will yield no hits IT Systems & Services From jmartinez@emediamillworks.com Tue Mar 12 22:26:01 2002 From: jmartinez@emediamillworks.com (Jorge O. Martinez) Date: Tue, 12 Mar 2002 17:26:01 -0500 Subject: [Zope-DB] Oracle 8.1.7.1 on Solaris 8 References: <3C8D0BD9.1050604@emediamillworks.com> <36334315.1015951562@[192.168.1.2]> <3C8E7096.2050700@emediamillworks.com> <053001c1ca0c$ef234950$4bdf1081@ita.chalmers.se> Message-ID: <3C8E8079.9070003@emediamillworks.com> Dario: We are planning to install it on a lower end Sun box, a single processor UltraSPARC IIi, but those problems seem pretty nasty anyway. Anyone has more recent experience with Solaris on lower end HW? BTW Thanks for your feedback Dario and Paul. Regards, Jorge M. Dario Lopez-Kästen wrote: > ----- Original Message ----- > From: "Jorge O. Martinez" > To: "Paul Browning" > Cc: > Sent: Tuesday, March 12, 2002 10:18 PM > Subject: Re: [Zope-DB] Oracle 8.1.7.1 on Solaris 8 > > > >>Paul: >> >>Really? That does not sound good. Could you get it to work though? >> >>Jorge M. >> > > Let me put it this way: it might be better now, but back then, because of > the problems that where, it force me to become the proud owner of a 2 CPU > dell rack.-mounted thing, running redhat. Until then, we where Solaris only > for servers. > > It really sucked on a Enterprise 450 with 1 or 2 gigs of ram and 4 CPUs. > > Python problems, threading problems zope instabilities... etc etc. > > Some of these issues have been resovled by pther snow, but zope the > threading problem is still there AFAIK. Zope really pushes Python to it's > limits and on solaris it seems to just not work well... > > Sorry to be so negative. > > /dario > > - -------------------------------------------------------------------- > Dario Lopez-Kästen Systems Developer Chalmers Univ. of Technology > dario@ita.chalmers.se ICQ will yield no hits IT Systems & Services > > > > _______________________________________________ > Zope-DB mailing list > Zope-DB@zope.org > http://lists.zope.org/mailman/listinfo/zope-db > -- Jorge O. Martinez MIS Senior Associate eMediaMillWorks 1100 Mercantile Lane, Suite 119 Largo, MD 20774 E-mail => jmartinez@eMediaMillWorks.com Phone => (301)883-2482 ext. 105 Fax => (301)883-9754 From alexb@runbox.com Wed Mar 13 06:57:39 2002 From: alexb@runbox.com (Alexander Batzios) Date: Tue, 12 Mar 2002 22:57:39 -0800 Subject: [Zope-DB] result set question Message-ID: <003601c1ca5c$6190b500$90e47d80@alexb> This is a multi-part message in MIME format. ------=_NextPart_000_0033_01C1CA19.4F59C180 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello. I am developing a search engine with Zope. It queries a mySQL database = according to the search criteria of a web form and outputs the results. = I have it working and all but I would like to ask two things: 1. Is it possible to split the results into pages of say 10 results? If = yes, how? Does Zope provide a way of doing this? Do I need to ask mySQL = to fetch the first 10 records, then the next 10, and so on? Is it = possible? 2. I want to have each record hyperlinked, so that when a user clicks on = it, he/she can view more details. Do I need to create a separate = database access object to handle these requests? I am sorry if these are too simple questions, but I am reading the = documentation and cannot find an exact answer. I am still trying to = grasp exactly how zope works. Thanks, Alex ------=_NextPart_000_0033_01C1CA19.4F59C180 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello.
 
I am developing a search engine with = Zope. It=20 queries a mySQL database according to the search criteria of a web form = and=20 outputs the results. I have it working and all but I would like to ask = two=20 things:
 
1. Is it possible to split the results = into pages=20 of say 10 results? If yes, how? Does Zope provide a way of doing this? = Do I need=20 to ask mySQL to fetch the first 10 records, then the next 10, and so on? = Is it=20 possible?
2. I want to have each record = hyperlinked, so that=20 when a user clicks on it, he/she can view more details. Do I need to = create a=20 separate database access object to handle these requests?
 
I am sorry if these are too simple = questions, but I=20 am reading the documentation and cannot find an exact answer. I am still = trying=20 to grasp exactly how zope works.
 
Thanks,
Alex
 
------=_NextPart_000_0033_01C1CA19.4F59C180-- From ct@gocept.com Wed Mar 13 07:20:29 2002 From: ct@gocept.com (Christian Theune) Date: Wed, 13 Mar 2002 08:20:29 +0100 Subject: [Zope-DB] result set question In-Reply-To: <003601c1ca5c$6190b500$90e47d80@alexb> References: <003601c1ca5c$6190b500$90e47d80@alexb> Message-ID: <20020313082029.A12165@pegasus.ct.gocept.com> Hi Alexander. * Alexander Batzios [020313 07:00]: > Hello. > > I am developing a search engine with Zope. It queries a mySQL database > according to the search criteria of a web form and outputs the results. I > have it working and all but I would like to ask two things: > > 1. Is it possible to split the results into pages of say 10 results? If yes, > how? Does Zope provide a way of doing this? Do I need to ask mySQL to fetch > the first 10 records, then the next 10, and so on? Is it possible? > Yes it is. See the dtml-in options in the dtml reference for "batching" to do so. (Zope Online Help in your ZMI -> Zope Help -> DTML Reference) > > 2. I want to have each record hyperlinked, so that when a user clicks on it, > he/she can view more details. Do I need to create a separate database access > object to handle these requests? Do you mean "Database connections"? Then the answer is "no". If you think to create a second query (Z SQL Method): for sure. If you need deeper help on the "database access object" try to post your questions using more well known terms. > I am sorry if these are too simple questions, but I am reading the > documentation and cannot find an exact answer. I am still trying to grasp > exactly how zope works. > > Thanks, Alex > No problem, but try using the Online Help of the ZMI more often, you will find a lot of useful informationen e.g. about DTML there. Greetings Christian -- Christian Theune - ct@gocept.com gocept gmbh & co.kg - schalaunische strasse 6 - 06366 koethen/anhalt tel.+49 3496 3099112 - fax.+49 3496 3099118 mob. - 0178 48 33 981 reduce(lambda x,y:x+y,[chr(ord(x)^42) for x in 'zS^BED\nX_FOY\x0b']) From matt@zope.com Wed Mar 13 12:11:04 2002 From: matt@zope.com (Matthew T. Kromer) Date: Wed, 13 Mar 2002 07:11:04 -0500 Subject: [Zope-DB] Oracle 8.1.7.1 on Solaris 8 In-Reply-To: <3C8E8079.9070003@emediamillworks.com> Message-ID: <6461CE35-367B-11D6-948C-003065488930@zope.com> Note that there are oodles of Sun patches for Solaris, a lot of them=20 relating to threading. Have you applied the latest Sun rollups? On Tuesday, March 12, 2002, at 05:26 PM, Jorge O. Martinez wrote: > Dario: > > We are planning to install it on a lower end Sun box, a single=20 > processor UltraSPARC IIi, but those problems seem pretty nasty anyway.=20= > Anyone has more recent experience with Solaris on lower end HW? BTW=20 > Thanks for your feedback Dario and Paul. > > Regards, > > Jorge M. > > Dario Lopez-K=E4sten wrote: > >> ----- Original Message ----- >> From: "Jorge O. Martinez" >> To: "Paul Browning" >> Cc: >> Sent: Tuesday, March 12, 2002 10:18 PM >> Subject: Re: [Zope-DB] Oracle 8.1.7.1 on Solaris 8 >>> Paul: >>> >>> Really? That does not sound good. Could you get it to work though? >>> >>> Jorge M. >>> >> Let me put it this way: it might be better now, but back then, = because=20 >> of >> the problems that where, it force me to become the proud owner of a 2=20= >> CPU >> dell rack.-mounted thing, running redhat. Until then, we where = Solaris=20 >> only >> for servers. >> It really sucked on a Enterprise 450 with 1 or 2 gigs of ram and 4=20 >> CPUs. >> Python problems, threading problems zope instabilities... etc etc. >> Some of these issues have been resovled by pther snow, but zope the >> threading problem is still there AFAIK. Zope really pushes Python to=20= >> it's >> limits and on solaris it seems to just not work well... >> Sorry to be so negative. >> /dario >> - = -------------------------------------------------------------------- >> Dario Lopez-K=E4sten Systems Developer Chalmers Univ. of = Technology >> dario@ita.chalmers.se ICQ will yield no hits IT Systems & = Services >> _______________________________________________ >> Zope-DB mailing list >> Zope-DB@zope.org >> http://lists.zope.org/mailman/listinfo/zope-db > > > -- Jorge O. Martinez > MIS Senior Associate > eMediaMillWorks > 1100 Mercantile Lane, Suite 119 > Largo, MD 20774 > E-mail =3D> jmartinez@eMediaMillWorks.com > Phone =3D> (301)883-2482 ext. 105 > Fax =3D> (301)883-9754 > > > _______________________________________________ > Zope-DB mailing list > Zope-DB@zope.org > http://lists.zope.org/mailman/listinfo/zope-db From joel@joelburton.com Wed Mar 13 13:32:29 2002 From: joel@joelburton.com (Joel Burton) Date: Wed, 13 Mar 2002 08:32:29 -0500 Subject: [Zope-DB] result set question In-Reply-To: <003601c1ca5c$6190b500$90e47d80@alexb> Message-ID: Splitting results is easy. Look at the Help docs for and you'll see the commands for batching. You might want to create a separate ZSQLMethod for the detail view of an object, or you might want to share your list-getting method. You can do things like: # ZSQLMethod # parameters: fooid:optional SELECT * FROM tblFoo WHERE fooid= And you can call this method w/o an id to get all records, or with an id to get just one. The downside is that it's less clear and that you're getting all fields for your list; if your table has many long fields, this is unneccessary work. However, it is less to write and less to maintain. Joel BURTON | joel@joelburton.com | joelburton.com | aim: wjoelburton Knowledge Management & Technology Consultant -----Original Message----- From: zope-db-admin@zope.org [mailto:zope-db-admin@zope.org]On Behalf Of Alexander Batzios Sent: Wednesday, March 13, 2002 1:58 AM To: zope-db@zope.org Subject: [Zope-DB] result set question Hello. I am developing a search engine with Zope. It queries a mySQL database according to the search criteria of a web form and outputs the results. I have it working and all but I would like to ask two things: 1. Is it possible to split the results into pages of say 10 results? If yes, how? Does Zope provide a way of doing this? Do I need to ask mySQL to fetch the first 10 records, then the next 10, and so on? Is it possible? 2. I want to have each record hyperlinked, so that when a user clicks on it, he/she can view more details. Do I need to create a separate database access object to handle these requests? I am sorry if these are too simple questions, but I am reading the documentation and cannot find an exact answer. I am still trying to grasp exactly how zope works. Thanks, Alex From ct@gocept.com Wed Mar 13 13:20:25 2002 From: ct@gocept.com (Christian Theune) Date: Wed, 13 Mar 2002 14:20:25 +0100 Subject: [Zope-DB] result set question In-Reply-To: References: <003601c1ca5c$6190b500$90e47d80@alexb> Message-ID: <20020313142025.E12165@pegasus.ct.gocept.com> Hi Joel. * Joel Burton [020313 13:40]: > Splitting results is easy. Look at the Help docs for and you'll > see the commands for batching. > > You might want to create a separate ZSQLMethod for the detail view of an > object, or you might want to share your list-getting method. You can do > things like: > > # ZSQLMethod > # parameters: fooid:optional > SELECT * FROM tblFoo > > WHERE fooid= > dtml provides some special things for that (they just got fixed ...) Would do the same. Greetings. Christian > > And you can call this method w/o an id to get all records, or with an id to > get just one. The downside is that it's less clear and that you're getting > all fields for your list; if your table has many long fields, this is > unneccessary work. However, it is less to write and less to maintain. > I would provide 2 Queries, for the case you don't want to retrieve all fields of a set or need to join some other tables for the detail view. This would save some speed and memory. -- Christian Theune - ct@gocept.com gocept gmbh & co.kg - schalaunische strasse 6 - 06366 koethen/anhalt tel.+49 3496 3099112 - fax.+49 3496 3099118 mob. - 0178 48 33 981 reduce(lambda x,y:x+y,[chr(ord(x)^42) for x in 'zS^BED\nX_FOY\x0b']) From joel@joelburton.com Wed Mar 13 18:11:12 2002 From: joel@joelburton.com (Joel Burton) Date: Wed, 13 Mar 2002 13:11:12 -0500 Subject: [Zope-DB] result set question In-Reply-To: <20020313142025.E12165@pegasus.ct.gocept.com> Message-ID: > dtml provides some special things for that (they just got fixed ...) > > > > Yep. Realistically, I usually don't use the and for most things, but for complicated cases where might be emitting one or more of several where clauses, there can be very helpful. > I would provide 2 Queries, for the case you don't want to > retrieve all fields of a set > or need to join some other tables for the detail view. This would > save some speed and memory. I would always use two myself; I suppose that some would argue that for simple selects, the speed/memory is insignificant. I prefer two in all cases beacuse it's clearer. From jmartinez@emediamillworks.com Mon Mar 18 22:43:09 2002 From: jmartinez@emediamillworks.com (Jorge O. Martinez) Date: Mon, 18 Mar 2002 17:43:09 -0500 Subject: [Zope-DB] Oracle 8.1.7.1 on Solaris 8 References: <3C8D0BD9.1050604@emediamillworks.com> <36334315.1015951562@[192.168.1.2]> Message-ID: <3C966D7D.5030100@emediamillworks.com> Hi: I have been able to install Zope, DCOracle2, and was able to make a connection to the DB, and execute simple queries displaying results just fine. However, I have not been able to get LOB's to work. I am following the examples from Peterb in: http://www.zope.org/Members/peterb/oracle_lobs I am trying to do a select blob, and I get the template to display the id (which is the argument I pass), but don't get anything for the knowledge_text (the blob), this is what I am getting: KNOWLEDGE ID KNOWLEDGE TEXT 44 SQL used: SELECT knowledge_id, knowledge_text FROM knowledge where knowledge_id = 44 I know it must be my error because I think I am not calling the "select" Python script correctly; I've tried several different ways, and get all kinds of errors. Anybody outthere knows what is the correct way to call it from the Z SQL Method? This is what I have in my Z SQL Method: ------------ SELECT knowledge_id, knowledge_text FROM knowledge ** I am including 1 of the ways how I tried to call the 'select' script but it does not work** ------------ And this is the code in the select Python script (same from the sample code). I've tried many different ways, this is just the latest: # Manually iterate over whole result set, copy into list of dicts just # like dictionaries() # except we also read all BLOBs in their entirety and put in the value, # not the LobLocator result = [] for row in container.sql_select_blob(id=id): lob = row['blob'] result.append({'id': row['id'], 'blob': lob.read()}) return result ** Note, I've tried this way, and also replacing the 'id=id' for 'id=knowledge_id', but it did not work, also I replaced the 'blob' for 'knowledge_text' (my blob), but it doesn't like it ** I am new to Python and Zope, hence this basic question. I am sure it must be something simple, so thanks for your patience, Regards, Jorge M. -- Jorge O. Martinez MIS Senior Associate eMediaMillWorks 1100 Mercantile Lane, Suite 119 Largo, MD 20774 E-mail => jmartinez@eMediaMillWorks.com Phone => (301)883-2482 ext. 105 Fax => (301)883-9754 From jmartinez@emediamillworks.com Tue Mar 19 15:11:34 2002 From: jmartinez@emediamillworks.com (Jorge O. Martinez) Date: Tue, 19 Mar 2002 10:11:34 -0500 Subject: [Zope-DB] Problem selecting Oracle LOB's Message-ID: <3C975526.2010907@emediamillworks.com> (I am resubmitting this question because I had initially sent it with the wrong subject, and figured people would think it's the same subject. Sorry about that). Hi: I have been able to install Zope, DCOracle2, and was able to make a connection to the DB, and execute simple queries displaying results just fine. However, I have not been able to get LOB's to work. I am following the examples from Peterb in: http://www.zope.org/Members/peterb/oracle_lobs I am trying to do a select blob, and I get the template to display the id (which is the argument I pass), but don't get anything for the knowledge_text (the LOB, which is only text), this is what I am getting: KNOWLEDGE ID KNOWLEDGE TEXT 44 SQL used: SELECT knowledge_id, knowledge_text FROM knowledge where knowledge_id = 44 I know it must be my error because I think I am not calling the "select" Python script correctly; I've tried several different ways, and get all kinds of errors. Anybody outthere knows what is the correct way to call it from the Z SQL Method? This is what I have in my Z SQL Method: ------------ SELECT knowledge_id, knowledge_text FROM knowledge ** I am including 1 of the ways how I tried to call the 'select' script but it does not work** ------------ And this is the code in the select Python script (same from the sample code). I've tried many different ways, this is just the latest: # Manually iterate over whole result set, copy into list of dicts just # like dictionaries() # except we also read all BLOBs in their entirety and put in the value, # not the LobLocator result = [] for row in container.sql_select_blob(id=id): lob = row['blob'] result.append({'id': row['id'], 'blob': lob.read()}) return result ** Note, I've tried this way, and also replacing the 'id=id' for 'id=knowledge_id', but it did not work, also I replaced the 'blob' for 'knowledge_text' (my blob), but it doesn't like it ** I am new to Python and Zope, hence this basic question. I am sure it must be something simple, so thanks for your patience, Regards, Jorge M. -- Jorge O. Martinez MIS Senior Associate eMediaMillWorks 1100 Mercantile Lane, Suite 119 Largo, MD 20774 E-mail => jmartinez@eMediaMillWorks.com Phone => (301)883-2482 ext. 105 Fax => (301)883-9754 From matt@zope.com Tue Mar 19 15:30:14 2002 From: matt@zope.com (Matthew T. Kromer) Date: Tue, 19 Mar 2002 10:30:14 -0500 Subject: [Zope-DB] Problem selecting Oracle LOB's References: <3C975526.2010907@emediamillworks.com> Message-ID: <3C975986.2070402@zope.com> Jorge O. Martinez wrote: > (I am resubmitting this question because I had initially sent it with > the wrong subject, and figured people would think it's the same > subject. Sorry about that). > > Hi: > > I have been able to install Zope, DCOracle2, and was able to make a > connection to the DB, and execute simple queries displaying results > just fine. > > However, I have not been able to get LOB's to work. I am following the > examples from Peterb in: > > http://www.zope.org/Members/peterb/oracle_lobs > > I am trying to do a select blob, and I get the template to display the > id (which is the argument I pass), but don't get anything for the > knowledge_text (the LOB, which is only text), this is what I am getting: > > KNOWLEDGE ID KNOWLEDGE TEXT > 44 I bet if you view source, you'll see the tag as the 2nd argument, which the browser is hiding because it thinks its a tag. > > SQL used: > SELECT > knowledge_id, knowledge_text > FROM > knowledge > where > knowledge_id = 44 > > > I know it must be my error because I think I am not calling the > "select" Python script correctly; I've tried several different ways, > and get all kinds of errors. Anybody outthere knows what is the > correct way to call it from the Z SQL Method? This is what I have in > my Z SQL Method: > > ------------ > > SELECT > knowledge_id, knowledge_text > FROM > knowledge > > > Because you test something named knowledge_id, you have to pass it in as a parameter... see below > > > > > > ** I am including 1 of the ways how I tried to call the 'select' > script but it does not work** > > ------------ > > And this is the code in the select Python script (same from the sample > code). I've tried many different ways, this is just the latest: > > # Manually iterate over whole result set, copy into list of dicts just > # like dictionaries() > # except we also read all BLOBs in their entirety and put in the > value, # not the LobLocator > > result = [] > for row in container.sql_select_blob(id=id): > lob = row['blob'] > result.append({'id': row['id'], 'blob': lob.read()}) > return result You want for row in container.sql_select_block(knowledge_id=id) ... presuming ID is the value you want to search for. It has to match the definition of the SQL method. Otherwise what you're doing is correct. Note that the latest DCOracle2 is "most correct" in CVS; I can't remember if there was a broken-ness to the LOB support in PR1. > > ** Note, I've tried this way, and also replacing the 'id=id' for > 'id=knowledge_id', but it did not work, also I replaced the 'blob' for > 'knowledge_text' (my blob), but it doesn't like it ** > > I am new to Python and Zope, hence this basic question. I am sure it > must be something simple, so thanks for your patience, > > Regards, > > Jorge M. > > -- Matt Kromer Zope Corporation http://www.zope.com/ From jmartinez@emediamillworks.com Tue Mar 19 15:48:19 2002 From: jmartinez@emediamillworks.com (Jorge O. Martinez) Date: Tue, 19 Mar 2002 10:48:19 -0500 Subject: [Zope-DB] Problem selecting Oracle LOB's References: <3C975526.2010907@emediamillworks.com> <3C975986.2070402@zope.com> Message-ID: <3C975DC3.30006@emediamillworks.com> Matt: You are absolutely right. I looked at the source, and this is coming back as well: 44 <--- THIS IS WHAT I SAW (DIDN'T SEE THIS) I'll try what you suggest. One question though. How do I call the 'select' method? Does this look correct to you: Thanks for your quick and accurate response, Jorge M. Matthew T. Kromer wrote: > Jorge O. Martinez wrote: > >> (I am resubmitting this question because I had initially sent it with >> the wrong subject, and figured people would think it's the same >> subject. Sorry about that). >> >> Hi: >> >> I have been able to install Zope, DCOracle2, and was able to make a >> connection to the DB, and execute simple queries displaying results >> just fine. >> >> However, I have not been able to get LOB's to work. I am following the >> examples from Peterb in: >> >> http://www.zope.org/Members/peterb/oracle_lobs >> >> I am trying to do a select blob, and I get the template to display the >> id (which is the argument I pass), but don't get anything for the >> knowledge_text (the LOB, which is only text), this is what I am getting: >> >> KNOWLEDGE ID KNOWLEDGE TEXT >> 44 > > > > I bet if you view source, you'll see the tag as the 2nd > argument, which the browser is hiding because it thinks its a tag. > >> >> SQL used: >> SELECT >> knowledge_id, knowledge_text >> FROM >> knowledge >> where >> knowledge_id = 44 >> >> >> I know it must be my error because I think I am not calling the >> "select" Python script correctly; I've tried several different ways, >> and get all kinds of errors. Anybody outthere knows what is the >> correct way to call it from the Z SQL Method? This is what I have in >> my Z SQL Method: >> >> ------------ >> >> SELECT >> knowledge_id, knowledge_text >> FROM >> knowledge >> >> >> > > > > Because you test something named knowledge_id, you have to pass it in as > a parameter... see below > >> >> >> >> >> >> ** I am including 1 of the ways how I tried to call the 'select' >> script but it does not work** >> >> ------------ >> >> And this is the code in the select Python script (same from the sample >> code). I've tried many different ways, this is just the latest: >> >> # Manually iterate over whole result set, copy into list of dicts just >> # like dictionaries() >> # except we also read all BLOBs in their entirety and put in the >> value, # not the LobLocator >> >> result = [] >> for row in container.sql_select_blob(id=id): >> lob = row['blob'] >> result.append({'id': row['id'], 'blob': lob.read()}) >> return result > > > > You want > > for row in container.sql_select_block(knowledge_id=id) > > ... presuming ID is the value you want to search for. It has to match > the definition of the SQL method. > > Otherwise what you're doing is correct. > > Note that the latest DCOracle2 is "most correct" in CVS; I can't > remember if there was a broken-ness to the LOB support in PR1. > >> >> ** Note, I've tried this way, and also replacing the 'id=id' for >> 'id=knowledge_id', but it did not work, also I replaced the 'blob' for >> 'knowledge_text' (my blob), but it doesn't like it ** >> >> I am new to Python and Zope, hence this basic question. I am sure it >> must be something simple, so thanks for your patience, >> >> Regards, >> >> Jorge M. >> >> > > -- Jorge O. Martinez MIS Senior Associate eMediaMillWorks 1100 Mercantile Lane, Suite 119 Largo, MD 20774 E-mail => jmartinez@eMediaMillWorks.com Phone => (301)883-2482 ext. 105 Fax => (301)883-9754 From matt@zope.com Tue Mar 19 16:19:53 2002 From: matt@zope.com (Matthew T. Kromer) Date: Tue, 19 Mar 2002 11:19:53 -0500 Subject: [Zope-DB] Problem selecting Oracle LOB's References: <3C975526.2010907@emediamillworks.com> <3C975986.2070402@zope.com> <3C975DC3.30006@emediamillworks.com> Message-ID: <3C976529.2010504@zope.com> Jorge O. Martinez wrote: > Matt: > > You are absolutely right. I looked at the source, and this is coming > back as well: > > > 44 <--- THIS IS WHAT I SAW > > (DIDN'T SEE THIS) > > > I'll try what you suggest. One question though. How do I call the > 'select' method? Does this look correct to you: > > > > > > Thanks for your quick and accurate response, > > Jorge M. > Hmm -- the select method? There's the select statment in your SQL method -- I think that's what you mean; so if you have a SQL method "myquery" from a Python script you results = context.myquery(parm1=value1, parm2=value2, parm3=value3) # etc for result in results: print result['column1'] print result['column2'] lob = result['lobcolumn'] lobvalue = lob.read() etc... -- Matt Kromer Zope Corporation http://www.zope.com/ From jmartinez@emediamillworks.com Tue Mar 19 21:34:49 2002 From: jmartinez@emediamillworks.com (Jorge O. Martinez) Date: Tue, 19 Mar 2002 16:34:49 -0500 Subject: [Zope-DB] Problem selecting Oracle LOB's References: <3C975526.2010907@emediamillworks.com> <3C975986.2070402@zope.com> <3C975DC3.30006@emediamillworks.com> <3C976529.2010504@zope.com> Message-ID: <3C97AEF9.3000603@emediamillworks.com> Hi Matt: You are right. I am probably confusing terms. I'll try using your hints. Thanks a lot for you help, I wasn't sure what was going on, and your telling to look for the LobLocator helped a lot. Regards, Jorge M. Matthew T. Kromer wrote: > Jorge O. Martinez wrote: > >> Matt: >> >> You are absolutely right. I looked at the source, and this is coming >> back as well: >> >> >> 44 <--- THIS IS WHAT I SAW >> >> (DIDN'T SEE THIS) >> >> >> I'll try what you suggest. One question though. How do I call the >> 'select' method? Does this look correct to you: >> >> >> >> >> >> Thanks for your quick and accurate response, >> >> Jorge M. >> > > Hmm -- the select method? > > There's the select statment in your SQL method -- I think that's what > you mean; so if you have a SQL method "myquery" from a Python script you > > results = context.myquery(parm1=value1, parm2=value2, parm3=value3) # etc > > for result in results: > print result['column1'] > print result['column2'] > > lob = result['lobcolumn'] > lobvalue = lob.read() > > > etc... > > -- Jorge O. Martinez MIS Senior Associate eMediaMillWorks 1100 Mercantile Lane, Suite 119 Largo, MD 20774 E-mail => jmartinez@eMediaMillWorks.com Phone => (301)883-2482 ext. 105 Fax => (301)883-9754 From andreas@andreas-jung.com Wed Mar 20 01:38:06 2002 From: andreas@andreas-jung.com (Andreas Jung) Date: Tue, 19 Mar 2002 20:38:06 -0500 Subject: [Zope-DB] BLOB in MySQL/Zope with MySQLdb ? Message-ID: <03cc01c1cfaf$e2aa42c0$02010a0a@suxlap> Is it possible to store data into BLOB columns in MySQL using MySQLdb and MySQLDA ? -aj From paul.browning@bristol.ac.uk Wed Mar 20 09:34:21 2002 From: paul.browning@bristol.ac.uk (Paul Browning) Date: Wed, 20 Mar 2002 09:34:21 -0000 Subject: [Zope-DB] Oracle 8.1.7.1 on Solaris 8 In-Reply-To: <3C8E7096.2050700@emediamillworks.com> References: <3C8E7096.2050700@emediamillworks.com> Message-ID: <47634655.1016616861@[192.168.1.2]> --On 12 March 2002 16:18 -0500 "Jorge O. Martinez" wrote: >> Yes. It can suck. Search the main zope list archives on "Solaris >> threading". I hope >> shortly to be in a position to share the results of an investigation into >> this area. Ok. It's there now: http://www.zope.org/Members/glpb/solaris Paul -- The Library, Tyndall Avenue, Univ. of Bristol, Bristol, BS8 1TJ, UK E-mail: paul.browning@bristol.ac.uk URL: http://www.bris.ac.uk/ From paul.browning@bristol.ac.uk Wed Mar 20 09:36:01 2002 From: paul.browning@bristol.ac.uk (Paul Browning) Date: Wed, 20 Mar 2002 09:36:01 -0000 Subject: [Zope-DB] Oracle 8.1.7.1 on Solaris 8 In-Reply-To: <3C8E8079.9070003@emediamillworks.com> References: <3C8E8079.9070003@emediamillworks.com> Message-ID: <47734819.1016616961@[192.168.1.2]> --On 12 March 2002 17:26 -0500 "Jorge O. Martinez" wrote: > Dario: > > We are planning to install it on a lower end Sun box, a single processor > UltraSPARC IIi, but those problems seem pretty nasty anyway. Anyone has > more recent experience with Solaris on lower end HW? BTW Thanks for your > feedback Dario and Paul. It's the multi-processor boxes that are (particularly) problematic. See http://www.zope.org/Members/glpb/solaris Paul -- The Library, Tyndall Avenue, Univ. of Bristol, Bristol, BS8 1TJ, UK E-mail: paul.browning@bristol.ac.uk URL: http://www.bris.ac.uk/ From paul.browning@bristol.ac.uk Wed Mar 20 09:37:07 2002 From: paul.browning@bristol.ac.uk (Paul Browning) Date: Wed, 20 Mar 2002 09:37:07 -0000 Subject: [Zope-DB] Oracle 8.1.7.1 on Solaris 8 In-Reply-To: <6461CE35-367B-11D6-948C-003065488930@zope.com> References: <6461CE35-367B-11D6-948C-003065488930@zope.com> Message-ID: <47800092.1016617027@[192.168.1.2]> --On 13 March 2002 07:11 -0500 "Matthew T. Kromer" wrote: > Note that there are oodles of Sun patches for Solaris, a lot of them > relating to threading. Have you applied the latest Sun rollups? This, indeed, is one of the recommendations made in http://www.zope.org/Members/glpb/solaris Paul -- The Library, Tyndall Avenue, Univ. of Bristol, Bristol, BS8 1TJ, UK E-mail: paul.browning@bristol.ac.uk URL: http://www.bris.ac.uk/ From matt@zope.com Wed Mar 20 15:24:11 2002 From: matt@zope.com (Matthew T. Kromer) Date: Wed, 20 Mar 2002 10:24:11 -0500 Subject: [Zope-DB] Oracle 8.1.7.1 on Solaris 8 References: <3C8E8079.9070003@emediamillworks.com> <47734819.1016616961@[192.168.1.2]> Message-ID: <3C98A99B.2030804@zope.com> Paul Browning wrote: > > It's the multi-processor boxes that are (particularly) problematic. > See http://www.zope.org/Members/glpb/solaris > > Paul That's a very good writeup; thanks, I'll keep it bookmarked. -- Matt Kromer Zope Corporation http://www.zope.com/ From joel@joelburton.com Wed Mar 20 15:38:09 2002 From: joel@joelburton.com (Joel Burton) Date: Wed, 20 Mar 2002 10:38:09 -0500 Subject: [Zope-DB] BLOB in MySQL/Zope with MySQLdb ? In-Reply-To: <03cc01c1cfaf$e2aa42c0$02010a0a@suxlap> Message-ID: > -----Original Message----- > From: zope-db-admin@zope.org [mailto:zope-db-admin@zope.org]On Behalf Of > Andreas Jung > Sent: Tuesday, March 19, 2002 8:38 PM > To: zope-db@zope.org > Subject: [Zope-DB] BLOB in MySQL/Zope with MySQLdb ? > > > Is it possible to store data into BLOB columns in MySQL > using MySQLdb and MySQLDA ? Andreas -- Works for me; I've stored PNG images in a BLOB and later used them to create Zope Image objs. Just use type=string in your . HTH. Joel BURTON | joel@joelburton.com | joelburton.com | aim: wjoelburton Knowledge Management & Technology Consultant From rguerin@free.fr Wed Mar 20 18:02:23 2002 From: rguerin@free.fr (Renaud Guerin) Date: Wed, 20 Mar 2002 19:02:23 +0100 Subject: [Zope-DB] Are transactions/atomicity implicit in ZSQL Methods ? + questions Message-ID: <200203201802.g2KI2Nn06444@sophia.inria.fr> Hello, I need to make a ZSQL method that inserts data in a table this way: 1) first, generate a new ID with something like SELECT MAX(ID)+1 AS my_id FROM ... 2) then, INSERT with the ID previously generated ( is INSERT INTO ... VALUES (.... the right way to do this ?) 3) display my_id to the user for future reference. I'm not sure how to do 3) : how do I pass my_id back to the original DTML document (which calls the ZSQL method with dtml-call) ? Also (main question), is there something particular to do to ensure SELECT+INSERT is done in a single transaction, thus avoiding concurrency problems ? thanks a lot! PS: please cc any answers. From ashleyg@dnai.com Wed Mar 20 20:54:16 2002 From: ashleyg@dnai.com (Ashley) Date: Wed, 20 Mar 2002 12:54:16 -0800 Subject: [Zope-DB] sqlvar tag has no type="boolean" Message-ID: <20020320125416.B15696@ishi.ashnet> Hi list, I'm now to zope (and sql also). I am using postgresql with psycopg. This is my first attempt to setup a Z SQL meathod to insert into my table. My table has several boolean attributes: CREATE TABLE contacts ( contact_id integer primary key ,owner boolean ,manager boolean ,buyer boolean ); I can not figure out how to get zope to insert into a boolean attribute. If I use sqlvar type="string", and enter true in the insert form, zope passes 'true' and postgresql chokes on the single quotes. Surely there is a work around. Any ideas? -- Ashley Gould 510.482.0525 3020 Kansas St. ashleyg@dnai.com Oakland, CA 94602 From k_vertigo@yahoo.com Wed Mar 20 17:25:28 2002 From: k_vertigo@yahoo.com (kapil thangavelu) Date: Wed, 20 Mar 2002 09:25:28 -0800 Subject: [Zope-DB] Are transactions/atomicity implicit in ZSQL Methods ? + questions In-Reply-To: <200203201802.g2KI2Nn06444@sophia.inria.fr> References: <200203201802.g2KI2Nn06444@sophia.inria.fr> Message-ID: <200203210011.g2L0B3197714@pimout5-int.prodigy.net> On Wednesday 20 March 2002 10:02 am, you wrote: > Hello, > > I need to make a ZSQL method that inserts data in a table this way: > 1) first, generate a new ID with something like SELECT MAX(ID)+1 AS my_id > FROM ... > 2) then, INSERT with the ID previously generated ( is INSERT INTO ... > VALUES (.... the right way to do this ?) it would be much better to use a sequence. the above is only safe in a transaction serialized mode. > 3) display my_id to the user for future reference. > > I'm not sure how to do 3) : how do I pass my_id back to the original DTML > document (which calls the ZSQL method with dtml-call) ? > > Also (main question), is there something particular to do to ensure > SELECT+INSERT is done in a single transaction, thus avoiding concurrency > problems ? zope's integration with databases depends on whats supported by the database adapter. if the adapter supports transactions than zope will commit transactions involving any changed persistent objects within zope and the dbs at the end of a request. -k From rguerin@free.fr Thu Mar 21 11:06:43 2002 From: rguerin@free.fr (rguerin@free.fr) Date: Thu, 21 Mar 2002 12:06:43 +0100 (MET) Subject: [Zope-DB] Are transactions/atomicity implicit in ZSQL+ Oracle ? In-Reply-To: <200203210011.g2L0B3197714@pimout5-int.prodigy.net> References: <200203201802.g2KI2Nn06444@sophia.inria.fr> <200203210011.g2L0B3197714@pimout5-int.prodigy.net> Message-ID: <1016708803.3c99bec3e2e05@imp.free.fr> En réponse à kapil thangavelu : > > I need to make a ZSQL method that inserts data in a table this way: > > 1) first, generate a new ID with something like SELECT MAX(ID)+1 AS > my_id > > FROM ... > > 2) then, INSERT with the ID previously generated ( is INSERT INTO > > VALUES (.... the right way to do this ?) > it would be much better to use a sequence. the above is only safe in a > transaction serialized mode. Unfortunately I can't modify the db structure or even add simple objects. My question is precisely this: is there explicit LOCKing to do to ensure serialization or does Zope do it automatically for all SQL statements in a single ZSQL method? > > Also (main question), is there something particular to do to ensure > > SELECT+INSERT is done in a single transaction, thus avoiding > concurrency > > problems ? > zope's integration with databases depends on whats supported by the > database > adapter. if the adapter supports transactions than zope will commit > transactions involving any changed persistent objects within zope and > the dbs > at the end of a request. By 'request' you mean http request ? If the Oracle DA supports transactions, which I guess it does, am I right to assume that the 2 SQL statements inside my ZSQL method are an atomic operation ? From kthangavelu@earthlink.net Thu Mar 21 04:58:52 2002 From: kthangavelu@earthlink.net (kapil thangavelu) Date: Wed, 20 Mar 2002 20:58:52 -0800 Subject: [Zope-DB] Are transactions/atomicity implicit in ZSQL+ Oracle ? In-Reply-To: <1016708803.3c99bec3e2e05@imp.free.fr> References: <200203201802.g2KI2Nn06444@sophia.inria.fr> <200203210011.g2L0B3197714@pimout5-int.prodigy.net> <1016708803.3c99bec3e2e05@imp.free.fr> Message-ID: <200203211144.g2LBiUZ219140@pimout4-int.prodigy.net> On Thursday 21 March 2002 03:06 am, rguerin@free.fr wrote: > En r=E9ponse =E0 kapil thangavelu : > > > I need to make a ZSQL method that inserts data in a table this way: > > > 1) first, generate a new ID with something like SELECT MAX(ID)+1 AS > > > > my_id > > > > > FROM ... > > > 2) then, INSERT with the ID previously generated ( is INSERT INTO > > > VALUES (.... the right way to do this ?) > > > > it would be much better to use a sequence. the above is only safe in = a > > transaction serialized mode. > > Unfortunately I can't modify the db structure or even add simple object= s. > My question is precisely this: is there explicit LOCKing to do to ensur= e > serialization or does Zope do it automatically for all SQL statements i= n a > single ZSQL method? > zope doesn't do any locking per say, it tries to handle transaction=20 integration to make all methods invoked during a request happen=20 transactionally. > > > Also (main question), is there something particular to do to ensure > > > SELECT+INSERT is done in a single transaction, thus avoiding > > > > concurrency > > > > > problems ? > > > > zope's integration with databases depends on whats supported by the > > database > > adapter. if the adapter supports transactions than zope will commit > > transactions involving any changed persistent objects within zope and > > the dbs > > at the end of a request. > > By 'request' you mean http request ? yes. > If the Oracle DA supports transactions, which I guess it does, am I rig= ht > to assume that the 2 SQL statements inside my ZSQL method are an atomic > operation ? you can assume transactionality. zope's transaction boundary is at the en= d of=20 an http request where it will attempt to commit to all db adapters involv= ed=20 during a request. which means all zsql methods involved in a http request= are=20 associated with a single transaction. of course this is not true if you a= re=20 manually manipulating the transaction. atomicity, depends on what you're doing and how you've set up the databas= e=20 connection/env, specifically its transaction isolation level. =20 hth -k=20 From rguerin@free.fr Thu Mar 21 14:47:38 2002 From: rguerin@free.fr (=?ISO-8859-1?Q?Renaud_Gu=E9rin?=) Date: Thu, 21 Mar 2002 15:47:38 +0100 (MET) Subject: [Zope-DB] Are transactions/atomicity implicit in ZSQL+ Oracle ? In-Reply-To: <200203211144.g2LBiUZ219140@pimout4-int.prodigy.net> References: <200203201802.g2KI2Nn06444@sophia.inria.fr> <200203210011.g2L0B3197714@pimout5-int.prodigy.net> <1016708803.3c99bec3e2e05@imp.free.fr> <200203211144.g2LBiUZ219140@pimout4-int.prodigy.net> Message-ID: <1016722058.3c99f28a67c63@imp.free.fr> En réponse à kapil thangavelu : > > > it would be much better to use a sequence. the above is only safe in > a > > > transaction serialized mode. > > Unfortunately I can't modify the db structure or even add simple > objects. > > My question is precisely this: is there explicit LOCKing to do to > ensure > > serialization or does Zope do it automatically for all SQL statements > in a > > single ZSQL method? > zope doesn't do any locking per say, it tries to handle transaction > integration to make all methods invoked during a request happen > transactionally. Ok > > If the Oracle DA supports transactions, which I guess it does, am I > right > > to assume that the 2 SQL statements inside my ZSQL method are an > atomic > > operation ? > you can assume transactionality. zope's transaction boundary is at the > end of > an http request where it will attempt to commit to all db adapters > involved > during a request. which means all zsql methods involved in a http > request are > associated with a single transaction. of course this is not true if you > are > manually manipulating the transaction. > atomicity, depends on what you're doing and how you've set up the > database > connection/env, specifically its transaction isolation level. I'm not in control of the Oracle+ZOracleDA installation, but my guess is that it's pretty much everything by default. What are the different transaction isolation levels ? Another question: would atomicity be better insured if I nested the SELECT statement inside the INSERT ? (ie: INSERT INTO table VALUES (SELECT ...., ....) thanks From scott@projtech.com Thu Mar 21 15:26:25 2002 From: scott@projtech.com (Scott Finnie) Date: Thu, 21 Mar 2002 15:26:25 +0000 Subject: [Zope-DB] Objectstore interface? Message-ID: <3C99FBA1.6F968A5E@projtech.com> Anyone know of a way to interface Zope to objectstore? Primary requirement is read, but write would be nice too. Thanks, Scott. From joel@joelburton.com Thu Mar 21 15:34:44 2002 From: joel@joelburton.com (Joel Burton) Date: Thu, 21 Mar 2002 10:34:44 -0500 Subject: [Zope-DB] sqlvar tag has no type="boolean" In-Reply-To: <20020320125416.B15696@ishi.ashnet> Message-ID: Works fine for me. I'm using PG 7.2, Zope 2.5.0, zpsycopg 1.11. What versions are you using? Joel BURTON | joel@joelburton.com | joelburton.com | aim: wjoelburton Knowledge Management & Technology Consultant > -----Original Message----- > From: zope-db-admin@zope.org [mailto:zope-db-admin@zope.org]On Behalf Of > Ashley > Sent: Wednesday, March 20, 2002 3:54 PM > To: zope-db@zope.org > Subject: [Zope-DB] sqlvar tag has no type="boolean" > > > Hi list, > > I'm now to zope (and sql also). I am using postgresql with > psycopg. This is > my first attempt to setup a Z SQL meathod to insert into my > table. My table > has several boolean attributes: > > CREATE TABLE contacts ( > contact_id integer primary key > ,owner boolean > ,manager boolean > ,buyer boolean > ); > > I can not figure out how to get zope to insert into a boolean attribute. > If I use sqlvar type="string", and enter true in the insert form, > zope passes > 'true' and postgresql chokes on the single quotes. > > Surely there is a work around. Any ideas? > > > -- > Ashley Gould 510.482.0525 > 3020 Kansas St. ashleyg@dnai.com > Oakland, CA 94602 > > _______________________________________________ > Zope-DB mailing list > Zope-DB@zope.org > http://lists.zope.org/mailman/listinfo/zope-db > From phil@harris-family.info Thu Mar 21 15:37:34 2002 From: phil@harris-family.info (Phil Harris) Date: Thu, 21 Mar 2002 15:37:34 -0000 Subject: [Zope-DB] zFireBirdDA - A new FireBird/InterBase db adaptor Message-ID: <009901c1d0ee$547c4a30$5c773fc1@media1> Hi all, Just a note to say that I've just released a new Interbase/FireBird database adaptor, ZFireBirdDA. I'm looking for people willing to test it, but you must be willing to have it destroy your database ;). It's available at http://www.zope.org/Members/philh. This da is based on kinterbasdb, which is supposed to be thread safe and also a level 3 DB connector. It may offer a significant improvement in terms of thread efficency over the gvib DA. Anyway, I'd be pleased to see people trying it, and breaking it ;) Thanks for listening Phil Harris From ashleyg@dnai.com Thu Mar 21 23:56:03 2002 From: ashleyg@dnai.com (Ashley) Date: Thu, 21 Mar 2002 15:56:03 -0800 Subject: [Zope-DB] sqlvar tag has no type="boolean" In-Reply-To: References: <20020320125416.B15696@ishi.ashnet> Message-ID: <20020321155603.A21451@ishi.ashnet> I'm using the same versions as you. I got my inserts to work by using instead of on boolean attributes. I'm trying to use radio buttons to force either true of false values from the user. I really am a beginner though. So far zope has been kicking my ass but good. ashley On Thu, Mar 21, 2002 at 10:34:44AM -0500, Joel Burton wrote: > Works fine for me. I'm using PG 7.2, Zope 2.5.0, zpsycopg 1.11. > > What versions are you using? > > Joel BURTON | joel@joelburton.com | joelburton.com | aim: wjoelburton > Knowledge Management & Technology Consultant > > > -----Original Message----- > > From: zope-db-admin@zope.org [mailto:zope-db-admin@zope.org]On Behalf Of > > Ashley > > Sent: Wednesday, March 20, 2002 3:54 PM > > To: zope-db@zope.org > > Subject: [Zope-DB] sqlvar tag has no type="boolean" > > > > > > Hi list, > > > > I'm now to zope (and sql also). I am using postgresql with > > psycopg. This is > > my first attempt to setup a Z SQL meathod to insert into my > > table. My table > > has several boolean attributes: > > > > CREATE TABLE contacts ( > > contact_id integer primary key > > ,owner boolean > > ,manager boolean > > ,buyer boolean > > ); > > > > I can not figure out how to get zope to insert into a boolean attribute. > > If I use sqlvar type="string", and enter true in the insert form, > > zope passes > > 'true' and postgresql chokes on the single quotes. > > > > Surely there is a work around. Any ideas? > > > > > > -- > > Ashley Gould 510.482.0525 > > 3020 Kansas St. ashleyg@dnai.com > > Oakland, CA 94602 > > > > _______________________________________________ > > Zope-DB mailing list > > Zope-DB@zope.org > > http://lists.zope.org/mailman/listinfo/zope-db > > -- Ashley Gould 510.482.0525 3020 Kansas St. ashleyg@dnai.com Oakland, CA 94602 From zen@shangri-la.dropbear.id.au Fri Mar 22 04:45:43 2002 From: zen@shangri-la.dropbear.id.au (Stuart Bishop) Date: Fri, 22 Mar 2002 15:45:43 +1100 Subject: [Zope-DB] Are transactions/atomicity implicit in ZSQL+ Oracle ? In-Reply-To: <1016722058.3c99f28a67c63@imp.free.fr> Message-ID: On Friday, March 22, 2002, at 01:47 AM, Renaud Gu=E9rin wrote: > Another question: would atomicity be better insured if I nested the=20 > SELECT > statement inside the INSERT ? (ie: INSERT INTO table VALUES=20 > (SELECT ...., ....) The correct way of doing it is to use a sequence to generate the key, as Oracle guarantees that different transactions will not get the same next=20= value. Using MAX(foo)+1 has no such guarantees, as another process may issue = the same query simultaneously (in which case one of them will fail if the=20 column is constrained as unique). It may be possible to do something like: select max(foo) from bar for update insert into bar values (foo+1) or you might have to do: select foo from bar for update select max(foo) from bar insert into bar values (foo+1) The 'for update' locks the requested rows so other queries will block until the locking process commits or rolls back. But the best way is to use sequences for the purpose they were designed for :-) -- Stuart Bishop http://shangri-la.dropbear.id.au/ From kthangavelu@earthlink.net Fri Mar 22 02:17:27 2002 From: kthangavelu@earthlink.net (kapil thangavelu) Date: Thu, 21 Mar 2002 18:17:27 -0800 Subject: [Zope-DB] Are transactions/atomicity implicit in ZSQL+ Oracle ? In-Reply-To: <200203211144.g2LBiUZ219140@pimout4-int.prodigy.net> References: <200203201802.g2KI2Nn06444@sophia.inria.fr> <1016708803.3c99bec3e2e05@imp.free.fr> <200203211144.g2LBiUZ219140@pimout4-int.prodigy.net> Message-ID: <200203220903.g2M93DZ186892@pimout4-int.prodigy.net> On Wednesday 20 March 2002 08:58 pm, kapil thangavelu wrote: > > atomicity, depends on what you're doing and how you've set up the database > connection/env, specifically its transaction isolation level. ugh.... i think my brain went on auto pilot.. i meant isolation, not atomicity. as matt already posted to the zope@zope.org list, this can be done in oracle via a table lock command. the alternative i implied of setting the transaction isolation level to serializable has serious negative performance impacts. cheers kapil From k_vertigo@yahoo.com Fri Mar 22 02:22:16 2002 From: k_vertigo@yahoo.com (kapil thangavelu) Date: Thu, 21 Mar 2002 18:22:16 -0800 Subject: [Zope-DB] Are transactions/atomicity implicit in ZSQL+ Oracle ? In-Reply-To: References: Message-ID: <200203220908.g2M982Z12746@pimout4-int.prodigy.net> On Thursday 21 March 2002 08:45 pm, Stuart Bishop wrote: > On Friday, March 22, 2002, at 01:47 AM, Renaud Gu=E9rin wrote: > > Another question: would atomicity be better insured if I nested the > > SELECT > > statement inside the INSERT ? (ie: INSERT INTO table VALUES > > (SELECT ...., ....) > > The correct way of doing it is to use a sequence to generate the key, a= s > Oracle guarantees that different transactions will not get the same nex= t > value. > Using MAX(foo)+1 has no such guarantees, as another process may issue t= he > same query simultaneously (in which case one of them will fail if the > column is > constrained as unique). It may be possible to do something like: > select max(foo) from bar for update > > insert into bar values (foo+1) > > or you might have to do: > select foo from bar for update > > select max(foo) from bar > > insert into bar values (foo+1) > > The 'for update' locks the requested rows so other queries will block > until the locking process commits or rolls back. But the best way is > to use sequences for the purpose they were designed for :-) will a for update even work here? my understanding is that its a row locking facility, but since max is an=20 aggregate function, will this in turn automajically lock the table, if no= t=20 then this won't work. =20 curious, kapil From bobc@p-wave.com Fri Mar 22 20:10:57 2002 From: bobc@p-wave.com (Bob Corriher) Date: Fri, 22 Mar 2002 15:10:57 -0500 Subject: [Zope-DB] Re: Zope-DB digest, Vol 1 #131 - 4 msgs References: Message-ID: <3C9B8FD1.AE498DED@p-wave.com> I have been able to use for booleans in postgreSQL withe the following syntax: ::bool. I pass 1 for true and 0 for false. I use the POPY DA, but I think this should work with psycopg. Bob Corriher P-Wave Inc. On Thu, Mar 21, 2002 at 10:34:44AM -0500, Joel Burton wrote: > Works fine for me. I'm using PG 7.2, Zope 2.5.0, zpsycopg 1.11. > > What versions are you using? > > Joel BURTON | joel@joelburton.com | joelburton.com | aim: wjoelburton > Knowledge Management & Technology Consultant > > > -----Original Message----- > > From: zope-db-admin@zope.org [mailto:zope-db-admin@zope.org]On Behalf Of > > Ashley > > Sent: Wednesday, March 20, 2002 3:54 PM > > To: zope-db@zope.org > > Subject: [Zope-DB] sqlvar tag has no type="boolean" > > > > > > Hi list, > > > > I'm now to zope (and sql also). I am using postgresql with > > psycopg. This is > > my first attempt to setup a Z SQL meathod to insert into my > > table. My table > > has several boolean attributes: > > > > CREATE TABLE contacts ( > > contact_id integer primary key > > ,owner boolean > > ,manager boolean > > ,buyer boolean > > ); > > > > I can not figure out how to get zope to insert into a boolean attribute. > > If I use sqlvar type="string", and enter true in the insert form, > > zope passes > > 'true' and postgresql chokes on the single quotes. > > > > Surely there is a work around. Any ideas? > > > > > > -- > > Ashley Gould 510.482.0525 > > 3020 Kansas St. ashleyg@dnai.com > > Oakland, CA 94602 > > > > _______________________________________________ > > Zope-DB mailing list > > Zope-DB@zope.org > > http://lists.zope.org/mailman/listinfo/zope-db > > -- Ashley Gould 510.482.0525 3020 Kansas St. ashleyg@dnai.com Oakland, CA 94602 From emmanuel.courcelle@toulouse.inra.fr Mon Mar 25 14:44:06 2002 From: emmanuel.courcelle@toulouse.inra.fr (Emmanuel Courcelle) Date: Mon, 25 Mar 2002 15:44:06 +0100 Subject: [Zope-DB] How to use commit/rollback etc. with Zope + ZpsycopgDA ??? Message-ID: <3C9F37B6.2480B8E0@toulouse.inra.fr> Hello. I am currently developping an user interface towards a postgresql database, using Zope + ZpsycopgDA. Here is my pb: I have a python external script, with some code like: ##### context.zsql_some_zsql_method(...) for i in some_list: context.zsql_some_other_zsql_method(...) ##### The pb is that if one of the context.zsql_some_other_method(...) gets an error, the database is inconsistent. This could be solved using only ONE transaction, BUT the Zope zsql methods are wrapped inside a transaction, so that I have a transaction for EACH zsql call.=20 I would prefer ONE transaction for the WHOLE process.=20 I cannot insert all the sql code inside the same zsql method, because as fas a I know it is not possible implementing for loops inside a zsql method. So, what is the solution ??? Thanks in advance, --=20 Emmanuel COURCELLE emmanuel.courcelle@toulouse.inra.fr L.B.M.R.P.M. (C.N.R.S.-I.N.R.A.) tel (33) 5-61-28-54-50 B.P.27 - 31326 CASTANET TOLOSAN Cedex ------ S'ils te demandent de te taire, d'attendre, de patienter encore N'=E9coute que ton =E2me et agis. Djur Djura From fog@debian.org Tue Mar 26 00:43:50 2002 From: fog@debian.org (Federico Di Gregorio) Date: 26 Mar 2002 01:43:50 +0100 Subject: [Zope-DB] How to use commit/rollback etc. with Zope + ZpsycopgDA ??? In-Reply-To: <3C9F37B6.2480B8E0@toulouse.inra.fr> References: <3C9F37B6.2480B8E0@toulouse.inra.fr> Message-ID: <1017103431.3414.2.camel@nenya> --=-La8wo5f9FY4BLUhiL5k0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Il lun, 2002-03-25 alle 15:44, Emmanuel Courcelle ha scritto: [snip] > The pb is that if one of the context.zsql_some_other_method(...) gets > an error, > the database is inconsistent. This could be solved using only ONE > transaction, > BUT the Zope zsql methods are wrapped inside a transaction, so that > I have a transaction for EACH zsql call.=20 this looks strange. i always tought (and it always worked that way) that zope only execute a ._finish() on the connection just before sending the data back (i.e., just one transaction no matter how many zsql methods you call.) what version of psycopg are you using? not 1.1pre2 i hope, transaction management is seriously broken in the 1.1 series.=20 ciao, federico --=20 Federico Di Gregorio Debian GNU/Linux Developer & Italian Press Contact fog@debian.org INIT.D Developer fog@initd.org The number of the beast: vi vi vi. -- Delexa Jones --=-La8wo5f9FY4BLUhiL5k0 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: Per informazioni si veda http://www.gnupg.org iEYEABECAAYFAjyfxEYACgkQvcCgrgZGjevUZACfS8qkH7fA6FHAK14KzglWN/XD zKMAoJ5mCng43eGQzv6ykgJoWDnSI322 =Y1ZV -----END PGP SIGNATURE----- --=-La8wo5f9FY4BLUhiL5k0-- From emmanuel.courcelle@toulouse.inra.fr Tue Mar 26 11:21:18 2002 From: emmanuel.courcelle@toulouse.inra.fr (Emmanuel Courcelle) Date: Tue, 26 Mar 2002 12:21:18 +0100 Subject: [Zope-DB] How to use commit/rollback etc. with Zope +ZpsycopgDA ??? References: <3C9F37B6.2480B8E0@toulouse.inra.fr> <1017103431.3414.2.camel@nenya> Message-ID: <3CA059AE.B95B41EE@toulouse.inra.fr> Federico Di Gregorio wrote: > > Il lun, 2002-03-25 alle 15:44, Emmanuel Courcelle ha scritto: > [snip] > > The pb is that if one of the context.zsql_some_other_method(...) gets > > an error, > > the database is inconsistent. This could be solved using only ONE > > transaction, > > BUT the Zope zsql methods are wrapped inside a transaction, so that > > I have a transaction for EACH zsql call. > > this looks strange. i always tought (and it always worked that way) that > zope only execute a ._finish() on the connection just before sending the > data back (i.e., just one transaction no matter how many zsql methods > you call.) what version of psycopg are you using? not 1.1pre2 i hope, > transaction management is seriously broken in the 1.1 series. > > OK Thanks for your answer, the pb is that I did not correctly manage the exception. I am currently using psycpg 1.0.6, it works perfectly well for me. Here is the solution I found (is there a better solution ?): Instead of just writing: ##### context.zsql_some_zsql_method(...) for i in some_list: context.zsql_some_other_zsql_method(...) ##### I did write: ##### t = get_transaction() try: context.zsql_some_zsql_method(...) for i in some_list: context.zsql_some_other_zsql_method(...) except: t.abort() raise ##### And everything seems to be OK now. Thanks for your help !!! Salut. -- Emmanuel COURCELLE emmanuel.courcelle@toulouse.inra.fr L.B.M.R.P.M. (C.N.R.S.-I.N.R.A.) tel (33) 5-61-28-54-50 B.P.27 - 31326 CASTANET TOLOSAN Cedex ------ Pourquoi, j'voudrais savoir pourquoi, pourquoi, c'est les oiseaux jamais les balles, qu'on arrete en plein vol ? http://www.kulichki.com/vv/ From Tom Deprez" Hi, I looked at the Sybase Driver, the page tells that it is last modified at 2002/03/20, but the latest source is from 2000/02/20. Is there a newer version of the driver or is the modification of the page not an important thing? Tom. From matt@zope.com Thu Mar 28 15:59:04 2002 From: matt@zope.com (Matthew T. Kromer) Date: Thu, 28 Mar 2002 10:59:04 -0500 Subject: [Zope-DB] ZSybase DA References: <00f301c1d66d$83bb15e0$1e71a8c0@u10136> Message-ID: <3CA33DC8.8050506@zope.com> Tom Deprez wrote: >Hi, > >I looked at the Sybase Driver, the page tells that it is last modified at >2002/03/20, but the latest source is from 2000/02/20. >Is there a newer version of the driver or is the modification of the page >not an important thing? > >Tom. > The modification of the page was probably something trivial. -- Matt Kromer Zope Corporation http://www.zope.com/ From Tom Deprez" Hi, How do most people connect Zope with Sybase -both running on a linux platform-, today? Thanks, Tom.