From ponda7777 at hotmail.com Thu Nov 16 00:23:08 2006 From: ponda7777 at hotmail.com (oknam park) Date: Thu Nov 16 00:23:12 2006 Subject: [Zope-DB] URL Loading Error - Zope+MySQL Message-ID: Hi All, I'm trying to add data in mysql database using DTML in Zope. But, all other fields are okay. But, url fiels does not call URL I entered. Instead it generates the url for add dtml method like http://www.thegateway.org/about/gemingeneral/gemConsortium/memberDirectory/contactadd. Could you give me some piece of advice how to handle? Any advice would be really appreciated. Best regards, Nam Here is my add dtml method:

New Member Information Added!!

View all Member Information| View Added Information
Edit Member Information | Delete Member Information | Add Member Information

Member Information Add

SiteID:
Agency:
URL:
Last Name:
Here is memberlist2 page:

Member Information Update


Add a New Member Information _________________________________________________________________ Get the latest Windows Live Messenger 8.1 Beta version. Join now. http://ideas.live.com From lists at zopyx.com Thu Nov 16 00:44:12 2006 From: lists at zopyx.com (Andreas Jung) Date: Thu Nov 16 00:44:40 2006 Subject: [Zope-DB] URL Loading Error - Zope+MySQL In-Reply-To: References: Message-ID: <5D5DEEF46A1B7A8A02988E9D@[192.168.0.28]> Your posting really does not contain anything related to your question. You provide the code of a form and ask about putting the stuff into a database. What do you want to tell us? You need to write a ZSQL method. Everything is documented here -aj --On 16. November 2006 05:23:08 +0000 oknam park wrote: > Hi All, > > I'm trying to add data in mysql database using DTML in Zope. > > But, all other fields are okay. But, url fiels does not call URL I > entered. Instead it > generates the url for add dtml method like > http://www.thegateway.org/about/gemingeneral/gemConsortium/memberDirector > y/contactadd. > > Could you give me some piece of advice how to handle? > Any advice would be really appreciated. Best regards, Nam > > Here is my add dtml method: > > > >

New Member Information Added!!

>

> View all Member Information| > View Added > Information >
> Edit Member Information | > Delete Member Information | > Add Member Information >
> > >

Member Information Add

>
> > > > > > > > > > > > > > > > > > > > > > > > >
align="center">SiteID:
align="center">Agency:
URL:
Last > Name:
> type="submit" name="submit" value="Add"> > >
>
> > Here is memberlist2 page: > >

Member Information Update

> > >
> Add a New Member Information > > > _________________________________________________________________ > Get the latest Windows Live Messenger 8.1 Beta version.?Join now. > http://ideas.live.com > > _______________________________________________ > Zope-DB mailing list > Zope-DB@zope.org > http://mail.zope.org/mailman/listinfo/zope-db -- ZOPYX Ltd. & Co. KG - Charlottenstr. 37/1 - 72070 T?bingen - Germany Web: www.zopyx.com - Email: info@zopyx.com - Phone +49 - 7071 - 793376 E-Publishing, Python, Zope & Plone development, Consulting -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 186 bytes Desc: not available Url : http://mail.zope.org/pipermail/zope-db/attachments/20061116/c7c23665/attachment.bin From ponda7777 at hotmail.com Thu Nov 16 01:10:11 2006 From: ponda7777 at hotmail.com (oknam park) Date: Thu Nov 16 01:10:20 2006 Subject: [Zope-DB] URL Loading Error - Zope+MySQL In-Reply-To: <5D5DEEF46A1B7A8A02988E9D@[192.168.0.28]> Message-ID: Hi, Terribly Sorry for cross posting. and not clear explanation. Sincerely, Nam >From: Andreas Jung >Reply-To: Andreas Jung >To: oknam park , zope-db@zope.org >Subject: Re: [Zope-DB] URL Loading Error - Zope+MySQL >Date: Thu, 16 Nov 2006 06:44:12 +0100 > >Your posting really does not contain anything related to your question. >You provide the code of a form and ask about putting the stuff into >a database. What do you want to tell us? You need to write a ZSQL method. >Everything is documented here > > > >-aj > >--On 16. November 2006 05:23:08 +0000 oknam park >wrote: > >>Hi All, >> >>I'm trying to add data in mysql database using DTML in Zope. >> >>But, all other fields are okay. But, url fiels does not call URL I >>entered. Instead it >>generates the url for add dtml method like >>http://www.thegateway.org/about/gemingeneral/gemConsortium/memberDirector >>y/contactadd. >> >>Could you give me some piece of advice how to handle? >>Any advice would be really appreciated. Best regards, Nam >> >>Here is my add dtml method: >> >> >> >>

New Member Information Added!!

>>

>>View all Member Information| >>View Added >>Information >>
>>Edit Member Information | >>Delete Member Information | >>Add Member Information >>
>> >> >>

Member Information Add

>>
>> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>
>align="center">SiteID:
>align="center">Agency:
URL:
Last >>Name:
>>>type="submit" name="submit" value="Add"> >> >>
>>
>> >>Here is memberlist2 page: >> >>

Member Information Update

>> >> >>
>>Add a New Member Information >> >> >>_________________________________________________________________ >>Get the latest Windows Live Messenger 8.1 Beta version.?Join now. >>http://ideas.live.com >> >>_______________________________________________ >>Zope-DB mailing list >>Zope-DB@zope.org >>http://mail.zope.org/mailman/listinfo/zope-db > > > >-- >ZOPYX Ltd. & Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany >Web: www.zopyx.com - Email: info@zopyx.com - Phone +49 - 7071 - 793376 >E-Publishing, Python, Zope & Plone development, Consulting ><< attach3 >> _________________________________________________________________ Talk now to your Hotmail contacts with Windows Live Messenger. http://clk.atdmt.com/MSN/go/msnnkwme0020000001msn/direct/01/?href=http://get.live.com/messenger/overview From lists at zopyx.com Thu Nov 16 01:12:45 2006 From: lists at zopyx.com (Andreas Jung) Date: Thu Nov 16 01:13:02 2006 Subject: [Zope-DB] URL Loading Error - Zope+MySQL In-Reply-To: References: Message-ID: <7DBCFA451D6A29F87FEA7705@[192.168.0.28]> --On 16. November 2006 06:10:11 +0000 oknam park wrote: > > Hi, > > Terribly Sorry for cross posting. and not clear explanation. > Unclear? You posted a simple HTML form and said something about MySQL. All RDMBS issues *including examples* are documented when you follow the link and read about the RDBMS basics. Any problem with that? -aj -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 186 bytes Desc: not available Url : http://mail.zope.org/pipermail/zope-db/attachments/20061116/48d0596a/attachment.bin From jens at dataflake.org Thu Nov 16 03:58:03 2006 From: jens at dataflake.org (Jens Vagelpohl) Date: Thu Nov 16 03:58:13 2006 Subject: [Zope-DB] URL Loading Error - Zope+MySQL In-Reply-To: References: Message-ID: <9927E1EF-C555-4044-90CE-4140258A8E33@dataflake.org> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 16 Nov 2006, at 06:23, oknam park wrote: > Hi All, > > I'm trying to add data in mysql database using DTML in Zope. > > But, all other fields are okay. But, url fiels does not call URL I > entered. Instead it > generates the url for add dtml method like http:// > www.thegateway.org/about/gemingeneral/gemConsortium/memberDirectory/ > contactadd. > > Could you give me some piece of advice how to handle? > Any advice would be really appreciated. Best regards, Nam I see in your form that you call the input field URL - this is probably colliding with the "reserved word" URL that is part of the REQUEST object. Give the input field a different name. jens -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) iD8DBQFFXCghRAx5nvEhZLIRApKBAJ9HDC1VRSTrQ6bBllSdxyJq8PqjkQCfbgvI E2CnVQ7CgUK5Uc+AV3JPLe8= =Dhml -----END PGP SIGNATURE----- From maciej.wisniowski at coig.katowice.pl Fri Nov 17 11:31:36 2006 From: maciej.wisniowski at coig.katowice.pl (Maciej Wisniowski) Date: Fri Nov 17 11:31:28 2006 Subject: [Zope-DB] [ANN] Modified version of DCOracle2 is available Message-ID: <455DE3E8.9010509@coig.katowice.pl> Hi Due to discussion on Zope list and some work I did before I've published modified version of DCOracle2. What is in this version: 1. Bug fixes - StoredProcedures caused deadlocks in database - StoredProcedures caused conflict errors under heavy load removed self._errors reference and added _p_resolveConflict - other I don't remember now 2. Changes Changes are only in python files - DCOracle2 now uses connection pool Pool implementation is based on psycopg but it doesn't use volatile attributes. As a result: - Open/Close button in ZMI works as it should - DCOracle is possibly slower a bit - Ability to reconnect after the connection is broken When Oracle is restarted, connection is closed by firewall etc. Zope will show an error but only once for every broken connection. Second request will cause DCOracle2 to reconnect 3. To do: - Possibly useage of raise ConflictError may cause that there will be no errors shown during reconnect - Pool size attribute may be set via ZMI - Testing... This code is now in use at my company, but not yet in production environment. So far this works with Zope 2.8.x and Oracle9. If somebody knows better place for this code then let me know. Any ideas how should file headers (I mean licences) look? Comments are welcome Code is here: http://code.google.com/p/dcoracle2da/ Should be available via svn with: svn checkout http://dcoracle2da.googlecode.com/svn/trunk/ dcoracle2da THERE IS NO GUARANTEE THAT THIS WILL WORK FOR YOU, SO BE CAREFULL :) -- Maciej Wisniowski From chris at simplistix.co.uk Tue Nov 21 05:42:01 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Tue Nov 21 05:42:09 2006 Subject: [Zope-DB] [ANN] Modified version of DCOracle2 is available In-Reply-To: <455DE3E8.9010509@coig.katowice.pl> References: <455DE3E8.9010509@coig.katowice.pl> Message-ID: <4562D7F9.10704@simplistix.co.uk> Maciej Wisniowski wrote: > Due to discussion on Zope list and some work I did before > I've published modified version of DCOracle2. Can I suggest you sign a contributor agreement and contribute this directly to the Zope CVS or SVN repository? I think DCOracle2 may still be in CVS, but Jen Vagelpohl has become quite adept and moving things from one to the other. If you tickle him nicely, he may move it to SVN if it's not already there ;-) > What is in this version: > 1. Bug fixes > - StoredProcedures caused deadlocks in database > - StoredProcedures caused conflict errors under heavy load > removed self._errors reference and added _p_resolveConflict > - other I don't remember now With unit tests I hope? > 2. Changes > Changes are only in python files > - DCOracle2 now uses connection pool > Pool implementation is based on psycopg but > it doesn't use volatile attributes. Please be careful, I made one attempt at this and it's fiendishly difficult to get right... > As a result: > - Open/Close button in ZMI works as it should Hurrah! For the record, the DCOracle2 trunk in CVS did this too.. > - DCOracle is possibly slower a bit How so? > - Ability to reconnect after the connection is broken > When Oracle is restarted, connection is closed by firewall > etc. Zope will show an error but only once for every broken > connection. Second request will cause DCOracle2 to reconnect I may have done something similar on the trunk, I suggest you have a check how that code compares with yours... > - Testing... You really really really need to write the tests first for this kind of problem... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From jens at dataflake.org Tue Nov 21 08:10:33 2006 From: jens at dataflake.org (Jens Vagelpohl) Date: Tue Nov 21 08:10:36 2006 Subject: [Zope-DB] [ANN] Modified version of DCOracle2 is available In-Reply-To: <4562D7F9.10704@simplistix.co.uk> References: <455DE3E8.9010509@coig.katowice.pl> <4562D7F9.10704@simplistix.co.uk> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 21 Nov 2006, at 11:42, Chris Withers wrote: > I think DCOracle2 may still be in CVS, but Jens Vagelpohl has > become quite adept and moving things from one to the other. If you > tickle him nicely, he may move it to SVN if it's not already there ;-) Sorry, this is no longer the case, the required access privileges for me to do these migrations have been removed without warning. Jim Fulton and the ZC admin team are the only people who may perform tasks that require root-level access. Another good argument to push for the foundation to have their own infrastructure and move the repositories there. jens -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) iD8DBQFFYvrJRAx5nvEhZLIRAn+PAKCcNnZGfoqEEON49EQjRKnyom2s1gCdGzYX XjXzJvFnx+Tz+rZJVzoNr/0= =ceJO -----END PGP SIGNATURE----- From maciej.wisniowski at coig.katowice.pl Tue Nov 21 09:33:20 2006 From: maciej.wisniowski at coig.katowice.pl (Maciej Wisniowski) Date: Tue Nov 21 09:33:27 2006 Subject: [Zope-DB] [ANN] Modified version of DCOracle2 is available In-Reply-To: <4562D7F9.10704@simplistix.co.uk> References: <455DE3E8.9010509@coig.katowice.pl> <4562D7F9.10704@simplistix.co.uk> Message-ID: <45630E30.30803@coig.katowice.pl> > Can I suggest you sign a contributor agreement and contribute this > directly to the Zope CVS or SVN repository? I think DCOracle2 may > still be in CVS, but Jen Vagelpohl has become quite adept and moving > things from one to the other. If you tickle him nicely, he may move it > to SVN if it's not already there ;-) Seems that there is no DCOracle2 in SVN. I've just seen Jens answer. I'll think about. > With unit tests I hope? No. I'll possibly try to write some, but so far I have no idea how to write unit tests for things like conflict errors that appear under high load and tests without real Oracle database. I must admit that I've not looked at original DCO2 tests yet. I'll try and ask for help if needed :) > Please be careful, I made one attempt at this and it's fiendishly > difficult to get right... I've used pool implementation from psycopg so I think it is rather good code base. As I said before, after discussion with Dieter Maurer I've changed this a bit, that it doesn't use volatile atributes. I think the code in few places is even simpler now. So far it works for some time in a site used by hundred or more users (kind of test environment for end user) and I've seen no problems due to connection pool or lack of volatile attibutes yet. >> - Open/Close button in ZMI works as it should > As a result: > > Hurrah! For the record, the DCOracle2 trunk in CVS did this too.. Really? I can't find that code? You mean: http://cvs.zope.org/Products/DCOracle2/?only_with_tag=HEAD ? I've checked DABase.py and DB.py and nothing. > - DCOracle is possibly slower a bit > > How so? In standard implementation connection was usually ready in _v_database_connection, now, every time it has to be taken from the pool first. But I didn't tested this yet, but I will. >> When Oracle is restarted, connection is closed by firewall >> etc. Zope will show an error but only once for every broken >> connection. Second request will cause DCOracle2 to reconnect > - Ability to reconnect after the connection is broken > > I may have done something similar on the trunk, I suggest you have a > check how that code compares with yours... Seems your implementation is better! I'll have a closer look. Great thanks for the comments! -- Maciej Wisniowski From chris at simplistix.co.uk Tue Nov 21 10:30:28 2006 From: chris at simplistix.co.uk (Chris Withers) Date: Tue Nov 21 10:31:18 2006 Subject: [Zope-DB] [ANN] Modified version of DCOracle2 is available In-Reply-To: <45630E30.30803@coig.katowice.pl> References: <455DE3E8.9010509@coig.katowice.pl> <4562D7F9.10704@simplistix.co.uk> <45630E30.30803@coig.katowice.pl> Message-ID: <45631B94.1050706@simplistix.co.uk> Maciej Wisniowski wrote: >> Can I suggest you sign a contributor agreement and contribute this >> directly to the Zope CVS or SVN repository? I think DCOracle2 may >> still be in CVS, but Jen Vagelpohl has become quite adept and moving >> things from one to the other. If you tickle him nicely, he may move it >> to SVN if it's not already there ;-) > Seems that there is no DCOracle2 in SVN. > I've just seen Jens answer. I'll think about. It's in CVS. Yes, it's an old tool, but since Zope Corp have hamstrung the one person who was prepared to do this kind of migration, you/we/anyone has no choice but to use CVS :-( I'm CC'ing Jim in the vague hope that he could somehow arrange for Jens to get his privileges back :-S He can also help you with the contributor agreement side of things... >> With unit tests I hope? > No. I'll possibly try to write some, but so far I have no idea > how to write unit tests for things like conflict errors that > appear under high load and tests without real Oracle database. > I must admit that I've not looked at original DCO2 tests yet. > I'll try and ask for help if needed :) Yeah, I definitely wrote a suite of unit tests on my branch, I suspect they might need a live Oracle instance to connect to. ConflictErrors can be "simulated" but it is tricky... > I've used pool implementation from psycopg so I think it is rather > good code base. As I said before, after discussion with Dieter Maurer > I've changed this a bit, that it doesn't use volatile atributes. I think > the code in few places is even simpler now. So far it works for some > time in a site used by hundred or more users (kind of test environment > for end user) and I've seen no problems due to connection pool or lack > of volatile attibutes yet. Well, as I said, good luck ;-) I just spent a day debugging a similar type of issue in ZRDB/DA.py... >> Hurrah! For the record, the DCOracle2 trunk in CVS did this too.. > Really? I can't find that code? You mean: > http://cvs.zope.org/Products/DCOracle2/?only_with_tag=HEAD ? > I've checked DABase.py and DB.py and nothing. Looks like I never merged to HEAD :-S http://cvs.zope.org/Products/DCOracle2/?only_with_tag=chrisw_fixconnectionleak_branch >> - DCOracle is possibly slower a bit >> >> How so? > In standard implementation connection was > usually ready in _v_database_connection, now, > every time it has to be taken from the pool first. > But I didn't tested this yet, but I will. I think this will make no noticeable difference... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk From charlie at egenix.com Tue Nov 21 10:36:11 2006 From: charlie at egenix.com (Charlie Clark) Date: Tue Nov 21 10:36:23 2006 Subject: [Zope-DB] [ANN] Modified version of DCOracle2 is available In-Reply-To: <45630E30.30803@coig.katowice.pl> References: <455DE3E8.9010509@coig.katowice.pl> <4562D7F9.10704@simplistix.co.uk> <45630E30.30803@coig.katowice.pl> Message-ID: Am 21.11.2006, 15:33 Uhr, schrieb Maciej Wisniowski : >> Please be careful, I made one attempt at this and it's fiendishly >> difficult to get right... > I've used pool implementation from psycopg so I think it is rather > good code base. As I said before, after discussion with Dieter Maurer > I've changed this a bit, that it doesn't use volatile atributes. I think > the code in few places is even simpler now. So far it works for some > time in a site used by hundred or more users (kind of test environment > for end user) and I've seen no problems due to connection pool or lack > of volatile attibutes yet. Eek! ZpsycopgDA is GPL'd! Does that mean you've put your version of DCOracle under GPL? But that aside I am not sure it is the best implementation of connection pooling out there. Charlie From fog at initd.org Tue Nov 21 10:41:39 2006 From: fog at initd.org (Federico Di Gregorio) Date: Tue Nov 21 10:40:53 2006 Subject: [Zope-DB] [ANN] Modified version of DCOracle2 is available In-Reply-To: References: <455DE3E8.9010509@coig.katowice.pl> <4562D7F9.10704@simplistix.co.uk> <45630E30.30803@coig.katowice.pl> Message-ID: <1164123699.2909.81.camel@localhost> Il giorno mar, 21/11/2006 alle 16.36 +0100, Charlie Clark ha scritto: > Eek! ZpsycopgDA is GPL'd! Does that mean you've put your version of > DCOracle under GPL? I hope he did. But ZPsycopgDA is also distributed under the ZPL so there should be no problem unless he choosed an incompatible license. > But that aside I am not sure it is the best implementation of > connection pooling out there. I am sure it is not. But it is one of the simpliest, at least. :) federico -- Federico Di Gregorio http://people.initd.org/fog Debian GNU/Linux Developer fog@debian.org INIT.D Developer fog@initd.org Alla faccia della trasparenza! Ma che si fa, lo si prende e lo si mena? (In pubblico, per trasparenza.) -- -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Questa =?ISO-8859-1?Q?=E8?= una parte del messaggio firmata digitalmente Url : http://mail.zope.org/pipermail/zope-db/attachments/20061121/212f1e86/attachment.bin From charlie at egenix.com Tue Nov 21 10:44:23 2006 From: charlie at egenix.com (Charlie Clark) Date: Tue Nov 21 10:44:33 2006 Subject: [Zope-DB] [ANN] Modified version of DCOracle2 is available In-Reply-To: <1164123699.2909.81.camel@localhost> References: <455DE3E8.9010509@coig.katowice.pl> <4562D7F9.10704@simplistix.co.uk> <45630E30.30803@coig.katowice.pl> <1164123699.2909.81.camel@localhost> Message-ID: Am 21.11.2006, 16:41 Uhr, schrieb Federico Di Gregorio : > Il giorno mar, 21/11/2006 alle 16.36 +0100, Charlie Clark ha scritto: >> Eek! ZpsycopgDA is GPL'd! Does that mean you've put your version of >> DCOracle under GPL? > I hope he did. But ZPsycopgDA is also distributed under the ZPL so there > should be no problem unless he choosed an incompatible license. One of those things that happen all too easily... I'd forgotten you'd gone over to dual-licensing, thanks. >> But that aside I am not sure it is the best implementation of >> connection pooling out there. > I am sure it is not. But it is one of the simpliest, at least. I wasn't criticising it per se, of course, just the practice of following another implementation. Charlie From fog at initd.org Tue Nov 21 10:50:26 2006 From: fog at initd.org (Federico Di Gregorio) Date: Tue Nov 21 10:49:34 2006 Subject: [Zope-DB] [ANN] Modified version of DCOracle2 is available In-Reply-To: References: <455DE3E8.9010509@coig.katowice.pl> <4562D7F9.10704@simplistix.co.uk> <45630E30.30803@coig.katowice.pl> <1164123699.2909.81.camel@localhost> Message-ID: <1164124226.2909.86.camel@localhost> Il giorno mar, 21/11/2006 alle 16.44 +0100, Charlie Clark ha scritto: > > >> But that aside I am not sure it is the best implementation of > >> connection pooling out there. > > I am sure it is not. But it is one of the simpliest, at least. > > I wasn't criticising it per se, of course, just the practice of > following > another implementation. Yep, sorry. I forgot to add an ":)" after my comment. -- Federico Di Gregorio http://people.initd.org/fog Debian GNU/Linux Developer fog@debian.org INIT.D Developer fog@initd.org One key. One input. One enter. All right. -- An american consultant (then the system crashed and took down the *entire* network) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Questa =?ISO-8859-1?Q?=E8?= una parte del messaggio firmata digitalmente Url : http://mail.zope.org/pipermail/zope-db/attachments/20061121/7f6ac9d8/attachment.bin From maciej.wisniowski at coig.katowice.pl Tue Nov 21 14:46:51 2006 From: maciej.wisniowski at coig.katowice.pl (Maciej Wisniowski) Date: Tue Nov 21 14:47:18 2006 Subject: [Zope-DB] [ANN] Modified version of DCOracle2 is available In-Reply-To: <1164123699.2909.81.camel@localhost> References: <455DE3E8.9010509@coig.katowice.pl> <4562D7F9.10704@simplistix.co.uk> <45630E30.30803@coig.katowice.pl> <1164123699.2909.81.camel@localhost> Message-ID: <456357AB.1040103@coig.katowice.pl> >> Eek! ZpsycopgDA is GPL'd! Does that mean you've put your version of >> DCOracle under GPL? > > I hope he did. But ZPsycopgDA is also distributed under the ZPL so there > should be no problem unless he choosed an incompatible license. As you might see I've asked about licensing in my first post. So far code is at google site and I've chosen GPL 2.0 licensing for it. There still are old licence headers in files itself. I have no much experience with this, so thats why I asked about. Psycopg is GPL, DCOracle2 is ZPL. ZPL seems to be less restrictive. Am I right? >> But that aside I am not sure it is the best implementation of >> connection pooling out there. > > I am sure it is not. But it is one of the simpliest, at least. :) Yup, it is simple, and because of this I was able to implement this very quickly. It is also stable. I've used psycopg a lot, so that's why I've chosen this. I was not looking at other implementations so far. But any suggestions, what might be better, are welcome (also because of licensing). Anybody who wants to contribute is welcome too, of course. -- Maciej Wisniowski From maciej.wisniowski at coig.katowice.pl Tue Nov 21 17:58:20 2006 From: maciej.wisniowski at coig.katowice.pl (Maciej Wisniowski) Date: Tue Nov 21 17:58:31 2006 Subject: [Zope-DB] [ANN] Modified version of DCOracle2 is available In-Reply-To: <456357AB.1040103@coig.katowice.pl> References: <455DE3E8.9010509@coig.katowice.pl> <4562D7F9.10704@simplistix.co.uk> <45630E30.30803@coig.katowice.pl> <1164123699.2909.81.camel@localhost> <456357AB.1040103@coig.katowice.pl> Message-ID: <4563848C.3080809@coig.katowice.pl> I'll correct myself. > Psycopg is GPL, DCOracle2 is ZPL. As Federico said everything under ZPsycopgDA may be GPL or ZPL. I've used pool.py and pool_base.py. First is from ZPsycopgDA, latter not (but it is used by pool.py). Seems that is only possible to use GPL here, right? -- Maciej Wisniowski From fog at initd.org Tue Nov 21 18:03:29 2006 From: fog at initd.org (Federico Di Gregorio) Date: Tue Nov 21 18:02:38 2006 Subject: [Zope-DB] [ANN] Modified version of DCOracle2 is available In-Reply-To: <4563848C.3080809@coig.katowice.pl> References: <455DE3E8.9010509@coig.katowice.pl> <4562D7F9.10704@simplistix.co.uk> <45630E30.30803@coig.katowice.pl> <1164123699.2909.81.camel@localhost> <456357AB.1040103@coig.katowice.pl> <4563848C.3080809@coig.katowice.pl> Message-ID: <1164150209.2909.149.camel@localhost> Il giorno mar, 21/11/2006 alle 23.58 +0100, Maciej Wisniowski ha scritto: > I'll correct myself. > > Psycopg is GPL, DCOracle2 is ZPL. > As Federico said everything under ZPsycopgDA > may be GPL or ZPL. I've used pool.py and pool_base.py. > First is from ZPsycopgDA, latter not (but > it is used by pool.py). Seems that is only > possible to use GPL here, right? Yes. ZPsycopgDA can be under the ZPL because the ZPL is GPL-compatible. But if you directly include GPL'ed code you must use GPL. Have fun, federico -- Federico Di Gregorio http://people.initd.org/fog Debian GNU/Linux Developer fog@debian.org INIT.D Developer fog@initd.org Ma chi sei?....-il trafficante di Nutella? -- Giorgia -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Questa =?ISO-8859-1?Q?=E8?= una parte del messaggio firmata digitalmente Url : http://mail.zope.org/pipermail/zope-db/attachments/20061122/ac14b07f/attachment.bin From maciej.wisniowski at coig.katowice.pl Wed Nov 22 01:34:09 2006 From: maciej.wisniowski at coig.katowice.pl (Maciej Wisniowski) Date: Wed Nov 22 01:34:17 2006 Subject: [Zope-DB] [ANN] Modified version of DCOracle2 is available In-Reply-To: <1164150209.2909.149.camel@localhost> References: <455DE3E8.9010509@coig.katowice.pl> <4562D7F9.10704@simplistix.co.uk> <45630E30.30803@coig.katowice.pl> <1164123699.2909.81.camel@localhost> <456357AB.1040103@coig.katowice.pl> <4563848C.3080809@coig.katowice.pl> <1164150209.2909.149.camel@localhost> Message-ID: <4563EF61.9010603@coig.katowice.pl> > Yes. ZPsycopgDA can be under the ZPL because the ZPL is GPL-compatible. > But if you directly include GPL'ed code you must use GPL. > OK. Thanks for the answer. One more question. If I'll create application using ZPsycopgDA which is ZPL (but ZPsycopgDA uses psycopg which is GPL), then does my application have to be GPL too? Federico, as I see you're one of psycopg2 developers so a little question about this. I've found a bug in ZPsycopgDA. It should have one more statement when catching exceptions: if e.args[0].find("deadlock detected") > -1: raise ConflictError There are two places in ZPsycopgDA/db.py where above code should be added. These are near: if e.args[0].find("concurrent update") > -1: raise ConflictError Can I submit this issue somewhere (AFAIK there is no bugtracker at initd.org) or this e-mail is enough? The problem is in psycopg2. Zope3 psycopg implementation already has such statement. -- Maciej Wisniowski From fog at initd.org Wed Nov 22 04:12:46 2006 From: fog at initd.org (Federico Di Gregorio) Date: Wed Nov 22 04:11:55 2006 Subject: [Zope-DB] [ANN] Modified version of DCOracle2 is available In-Reply-To: <4563EF61.9010603@coig.katowice.pl> References: <455DE3E8.9010509@coig.katowice.pl> <4562D7F9.10704@simplistix.co.uk> <45630E30.30803@coig.katowice.pl> <1164123699.2909.81.camel@localhost> <456357AB.1040103@coig.katowice.pl> <4563848C.3080809@coig.katowice.pl> <1164150209.2909.149.camel@localhost> <4563EF61.9010603@coig.katowice.pl> Message-ID: <1164186766.3013.28.camel@localhost> Il giorno mer, 22/11/2006 alle 07.34 +0100, Maciej Wisniowski ha scritto: > > Yes. ZPsycopgDA can be under the ZPL because the ZPL is GPL-compatible. > > But if you directly include GPL'ed code you must use GPL. > > > OK. Thanks for the answer. One more question. > If I'll create application using ZPsycopgDA which > is ZPL (but ZPsycopgDA uses psycopg which is GPL), > then does my application have to be GPL too? I've seen infinite discussions about what a "mere aggregate" is and if using a standard API from an interpreted programming language is linking or not. psycopg2 is under the GPL so if you derive an adapter from it it should be under the GPL too. If you derive from ZPsycopgDA or write an app that used ZPysocpgDA you can go with anuthing compatible with the ZPL. Being the copyright holder for both I can choose any combination of licenses and by saying that ZPsycopgDA is (also) ZPL even if it calls psycopg that is GPL-only I suppose I am making a clear statement about what you can or can't do. > Can I submit this issue somewhere (AFAIK there > is no bugtracker at initd.org) or this e-mail > is enough? Please use our tracker at http://initd.org/tracker/psycopg. Thank you very much, federico -- Federico Di Gregorio http://people.initd.org/fog Debian GNU/Linux Developer fog@debian.org INIT.D Developer fog@initd.org Viviamo in un mondo reale, Ciccio. -- Lucy -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Questa =?ISO-8859-1?Q?=E8?= una parte del messaggio firmata digitalmente Url : http://mail.zope.org/pipermail/zope-db/attachments/20061122/743af4b4/attachment.bin From maciej.wisniowski at coig.katowice.pl Wed Nov 22 04:54:53 2006 From: maciej.wisniowski at coig.katowice.pl (Maciej Wisniowski) Date: Wed Nov 22 04:55:01 2006 Subject: [Zope-DB] [ANN] Modified version of DCOracle2 is available In-Reply-To: <1164186766.3013.28.camel@localhost> References: <455DE3E8.9010509@coig.katowice.pl> <4562D7F9.10704@simplistix.co.uk> <45630E30.30803@coig.katowice.pl> <1164123699.2909.81.camel@localhost> <456357AB.1040103@coig.katowice.pl> <4563848C.3080809@coig.katowice.pl> <1164150209.2909.149.camel@localhost> <4563EF61.9010603@coig.katowice.pl> <1164186766.3013.28.camel@localhost> Message-ID: <45641E6D.4040901@coig.katowice.pl> > Being the copyright holder for both I can choose any combination of > licenses and by saying that ZPsycopgDA is (also) ZPL even if it calls > psycopg that is GPL-only I suppose I am making a clear statement about > what you can or can't do. > Thank you. Now it is absolutely clear for me. > Please use our tracker at http://initd.org/tracker/psycopg. > Hm... I've registered but when I wanted to submit a ticket I get: TICKET_CREATE privileges are required to perform this operation -- Maciej Wisniowski From maciej.wisniowski at coig.katowice.pl Wed Nov 22 09:12:22 2006 From: maciej.wisniowski at coig.katowice.pl (Maciej Wisniowski) Date: Wed Nov 22 09:12:28 2006 Subject: [Zope-DB] [ANN] Modified version of DCOracle2 is available In-Reply-To: References: <455DE3E8.9010509@coig.katowice.pl> <4562D7F9.10704@simplistix.co.uk> <45630E30.30803@coig.katowice.pl> Message-ID: <45645AC6.30705@coig.katowice.pl> > Eek! ZpsycopgDA is GPL'd! Does that mean you've put your version of > DCOracle under GPL? > > But that aside I am not sure it is the best implementation of > connection pooling out there. I don't want to reinvent the whell and create own pool management so I searched a bit and found something interesting. What do you think about SQLAlchemy? It has is nice (I think) pool implementation, which may be used separately. See: http://www.sqlalchemy.org/docs/pooling.myt I'm especially interested in licensing. SQLAlchemy is on MIT license, so I think if it will be possible to use SQLAlchemy pool implementation then then this DCOracle2 version may be ZPL. Am I right? I did very first attempt to use this with my version of DCOracle2 and so far I am able to connect to Oracle from Zope and do some queries with SQLAlchemy QueuePool in use. If somebody wants to take a look then SQLAlchemized version, with some code from ChrisW branch (reconnect after connection is broken) is now at: https://dcoracle2da.googlecode.com/svn/branches/sqlalchemypool In general all this code is considered 'under developement'. There is nothing in tags/ yet. -- Maciej Wisniowski From dieter at handshake.de Wed Nov 22 13:45:44 2006 From: dieter at handshake.de (Dieter Maurer) Date: Wed Nov 22 13:45:24 2006 Subject: [Zope-DB] [ANN] Modified version of DCOracle2 is available In-Reply-To: <45645AC6.30705@coig.katowice.pl> References: <455DE3E8.9010509@coig.katowice.pl> <4562D7F9.10704@simplistix.co.uk> <45630E30.30803@coig.katowice.pl> <45645AC6.30705@coig.katowice.pl> Message-ID: <17764.39640.667998.766054@gargle.gargle.HOWL> Maciej Wisniowski wrote at 2006-11-22 15:12 +0100: > ... >I'm especially interested in licensing. >SQLAlchemy is on MIT license, so I think if it will be >possible to use SQLAlchemy pool implementation then >then this DCOracle2 version may be ZPL. Am I right? I fear that there is a rule that everything in the Zope repositories should be ZPL -- to have a uniform license for all components from these repositories. Of course, if your DCO2 is not in the Zope repositories, you should be able to include MIT licensed code in a ZPL licensed version of DCO2. -- Dieter From maciej.wisniowski at coig.katowice.pl Thu Nov 23 02:01:01 2006 From: maciej.wisniowski at coig.katowice.pl (Maciej Wisniowski) Date: Thu Nov 23 02:01:09 2006 Subject: [Zope-DB] [ANN] Modified version of DCOracle2 is available In-Reply-To: <17764.39640.667998.766054@gargle.gargle.HOWL> References: <455DE3E8.9010509@coig.katowice.pl> <4562D7F9.10704@simplistix.co.uk> <45630E30.30803@coig.katowice.pl> <45645AC6.30705@coig.katowice.pl> <17764.39640.667998.766054@gargle.gargle.HOWL> Message-ID: <4565472D.4090104@coig.katowice.pl> > I fear that there is a rule that everything in the Zope repositories > should be ZPL -- to have a uniform license for all components from > these repositories. > > Of course, if your DCO2 is not in the Zope repositories, > you should be able to include MIT licensed code in a ZPL licensed > version of DCO2. You are right but now I hope it is not necessary to put any MIT licensed code from SQLAlchemy into DCOracle2. Simple statement like: from SQLAlchemy.pool import QueuePool is enough. That just means that it is necessary to install SQLAlchemy to use this version of DCOracle2, but there are no parts of it's code here. Seems this is same as need to have Oracle Client installed in system in order to use DCOracle2. -- Maciej Wisniowski From tillea at rki.de Thu Nov 23 10:06:07 2006 From: tillea at rki.de (Andreas Tille) Date: Thu Nov 23 10:06:52 2006 Subject: [Zope-DB] dtml-let variables in sql queries Message-ID: Hi, I have defined the following table CREATE TABLE names ( nameid int, name text, fake int ); INSERT INTO names values ( 1, 'Alfons', 0 ); INSERT INTO names values ( 2, 'Alberto', 0 ); INSERT INTO names values ( 3, 'Adam', 0 ); INSERT INTO names values ( 4, 'Anibal', 0 ); INSERT INTO names values ( 5, 'Bert', 0 ); INSERT INTO names values ( 6, 'Caesar', 0 ); INSERT INTO names values ( 7, 'Dagobert', 1 ); INSERT INTO names values ( 8, 'Kuno', 1 ); GRANT SELECT ON names TO zope ; The following SQL-Method should extract all names where fake = 0 except if there are further parameters like name or nameid that should restrict the result set if they are given: name nameid SELECT * FROM names WHERE fake = 0 AND AND This works in the ZMI test tab as expected. The original problem is that I want to design a Form where you can specify only first letters like 'Al' and the query looks for "name like 'Al%'". I tried to do this using: Selected nameid=
Namepart =
Seek for name = ''.
where namepart is constructed as name+'%' to enable the like query. Unfortunately does not seem to work transparently in the SQL-Method, because this does not work and just prints every single name. If somebody wants to try this code here is the print_cases method:
Any idea why the variable namepart is not known in the SQL-Method while nameid is and works perfectly to select one name from the list? Many thanks Andreas. -- http://fam-tille.de From dev101 at magma.ca Thu Nov 23 10:17:32 2006 From: dev101 at magma.ca (Jonathan) Date: Thu Nov 23 10:17:43 2006 Subject: [Zope-DB] dtml-let variables in sql queries References: Message-ID: <000801c70f12$80587fe0$677ba8c0@DESKTOP> ----- Original Message ----- From: "Andreas Tille" To: Sent: Thursday, November 23, 2006 10:06 AM Subject: [Zope-DB] dtml-let variables in sql queries > Hi, > > I have defined the following table > > CREATE TABLE names ( > nameid int, > name text, > fake int > ); > > INSERT INTO names values ( 1, 'Alfons', 0 ); > INSERT INTO names values ( 2, 'Alberto', 0 ); > INSERT INTO names values ( 3, 'Adam', 0 ); > INSERT INTO names values ( 4, 'Anibal', 0 ); > INSERT INTO names values ( 5, 'Bert', 0 ); > INSERT INTO names values ( 6, 'Caesar', 0 ); > INSERT INTO names values ( 7, 'Dagobert', 1 ); > INSERT INTO names values ( 8, 'Kuno', 1 ); > > GRANT SELECT ON names TO zope ; > > The following SQL-Method should extract all names where > fake = 0 except if there are further parameters like > name or nameid that should restrict the result set if they > are given: > > name nameid > > > SELECT * FROM names > WHERE fake = 0 > > AND > > > AND > > > This works in the ZMI test tab as expected. > > The original problem is that I want to design a Form where > you can specify only first letters like 'Al' and the query > looks for "name like 'Al%'". I tried to do this using: > > > > > > > Selected nameid=
> >
> > > > > Namepart =
> > Seek for name = ''. > > >
> >
> >
>
>
> > > > > where namepart is constructed as name+'%' to enable the like > query. Unfortunately > > does not seem to work transparently in the SQL-Method, because > this does not work and just prints every single name. If somebody > wants to try this code here is the print_cases method: > > > > > >
> >
> > > Any idea why the variable namepart is not known in the SQL-Method > while nameid is and works perfectly to select one name from the list? > > Many thanks > > Andreas. First off, i would highly recommend using python scripts instead of DTML for the kind of processing you have described. That said, you have not described the GetCases method. If GetCases is the name of your SQL method, then you need to pass in the parameter 'nameid' hth Jonathan From tillea at rki.de Thu Nov 23 11:03:47 2006 From: tillea at rki.de (Andreas Tille) Date: Thu Nov 23 11:04:31 2006 Subject: [Zope-DB] Re: dtml-let variables in sql queries In-Reply-To: <000801c70f12$80587fe0$677ba8c0@DESKTOP> References: <000801c70f12$80587fe0$677ba8c0@DESKTOP> Message-ID: On Thu, 23 Nov 2006, Jonathan wrote: >> name nameid >> >> >> SELECT * FROM names >> WHERE fake = 0 >> >> AND >> >> >> AND >> > > First off, i would highly recommend using python scripts instead of DTML for > the kind of processing you have described. You are right here and I would definitely prefer Python scripts. The problem is that I'm using the Formulator Product and despite there are descriptions how to use it with Python scripts I failed while it was very straigtforeward to use DTML (in fact, this is the only part of my application in DTML). I just stripped down the application to a very simple example and avoided Formulator magic which is obviousely not the source of the problem. > That said, you have not described the GetCases method. I forgot to mention the name. It is the code snipped above. > If GetCases is the > name of your SQL method, then you need to pass in the parameter 'nameid' Well, nameid is not explicitely passed but taken from the parent out of and this works. The problem is that name which is builded out of Namepart =
is ignored by the SQL method and I fail to see the difference. The seems to be false in any case. Kind regards Andreas. -- http://fam-tille.de From dev101 at magma.ca Thu Nov 23 11:27:58 2006 From: dev101 at magma.ca (Jonathan) Date: Thu Nov 23 11:28:02 2006 Subject: [Zope-DB] Re: dtml-let variables in sql queries References: <000801c70f12$80587fe0$677ba8c0@DESKTOP> Message-ID: <000c01c70f1c$57147d50$677ba8c0@DESKTOP> ----- Original Message ----- From: "Andreas Tille" To: "Jonathan" Cc: Sent: Thursday, November 23, 2006 11:03 AM Subject: Re: dtml-let variables in sql queries > On Thu, 23 Nov 2006, Jonathan wrote: > >>> name nameid >>> >>> >>> SELECT * FROM names >>> WHERE fake = 0 >>> >>> AND >>> >>> >>> AND >>> >> >> First off, i would highly recommend using python scripts instead of DTML >> for the kind of processing you have described. > > You are right here and I would definitely prefer Python scripts. The > problem is that I'm using the Formulator Product and despite there are > descriptions how to use it with Python scripts I failed while it was > very straigtforeward to use DTML (in fact, this is the only part of > my application in DTML). I just stripped down the application to a > very simple example and avoided Formulator magic which is obviousely > not the source of the problem. > >> That said, you have not described the GetCases method. > > I forgot to mention the name. It is the code snipped above. > >> If GetCases is the name of your SQL method, then you need to pass in the >> parameter 'nameid' > > Well, nameid is not explicitely passed but taken from the parent > out of > > > > and this works. The problem is that name which is builded > out of > > > Namepart =
> > > is ignored by the SQL method and I fail to see the difference. > The seems to be false in any case. It may be due to the fact that the 'let' statement creates a variable in another part of the 'namespace' (ie. not in the REQUEST namespace). You could test this theory by replacing the dtml-let with a dtml-call REQUEST.set eg. Namepart =
hth Jonathan From charlie at egenix.com Thu Nov 23 11:35:55 2006 From: charlie at egenix.com (Charlie Clark) Date: Thu Nov 23 11:36:01 2006 Subject: [Zope-DB] Re: dtml-let variables in sql queries In-Reply-To: References: <000801c70f12$80587fe0$677ba8c0@DESKTOP> Message-ID: Am 23.11.2006, 17:03 Uhr, schrieb Andreas Tille : > You are right here and I would definitely prefer Python scripts. The > problem is that I'm using the Formulator Product and despite there are > descriptions how to use it with Python scripts I failed while it was > very straigtforeward to use DTML (in fact, this is the only part of > my application in DTML). I just stripped down the application to a > very simple example and avoided Formulator magic which is obviousely > not the source of the problem. It's easy enough to call Formulator from within a script and extract the results from it: result = context.MY_FORMULATOR_THINGY.validate_all(context.REQUEST) Make it work with a Script so you can forget all the evil DTML stuff, you won't regret it! Charlie From Klaus.Happle at haufe.de Thu Nov 23 12:59:03 2006 From: Klaus.Happle at haufe.de (Happle Dr., Klaus Martin) Date: Thu Nov 23 12:59:11 2006 Subject: AW: [Zope-DB] [ANN] Modified version of DCOracle2 is available In-Reply-To: <455DE3E8.9010509@coig.katowice.pl> Message-ID: Hi you remember my report http://mail.zope.org/pipermail/zope/2005-August/160762.html of an BUG for the handling of LONGs in DCO2? The consequence of this BUG is stochastic results for LONG fields We use an Fix of this BUG: Hint: The Documentation of the OCI from Oracle say us: defnp (IN), iter (IN), bufpp (OUT), alenpp (IN/OUT), piecep (IN/OUT), indpp (IN), rcodep (IN) Caution: When working with callback parameters, it is important to keep in mind what is meant by IN and OUT for the parameter mode. Normally, in an OCI function, an IN parameter refers to data being passed to Oracle, and an OUT parameter refers to data coming back from Oracle. In the case of callbacks, this is reversed. IN means data is coming from Oracle into the callback, and OUT means data is coming out of the callback and going to Oracle. Docu from OCI for OCIDefineByPos: indp (IN/OUT), alenp (IN/OUT), rcodep (OUT): Ignored for dynamic binds. First we fix Cursor_ResultSet and Second we fix Cursor_fetch: First Fix: static PyObject *Cursor_ResultSet(Cursor *self, int count) { PyObject *list; ResultSet *rs; int status; int i; sword mode = OCI_DEFAULT; dvoid *valuep; ub4 width; LongFetch *lf; TRACE(T_ENTRY,("sAd", "Cursor_ResultSet", self, count)); if (self->definition == NULL) { TRACE(T_ERROR,("ss","Cursor_ResultSet","description is NULL")); PyErr_SetString(ProgrammingErrorObject, "cursor description is None"); return NULL; } self->batchsz = count; if ((list = Py_BuildValue("[]")) == NULL) { TRACE(T_ERROR,("ss","Cursor_ResultSet", "PyBuildValue returned NULL")); return NULL; } for (i = 1; i <= PyList_Size(self->definition); i++) { mode = OCI_DEFAULT; if ((rs = (ResultSet *) ResultSet_alloc(self, i, count)) == NULL) { Py_DECREF(list); TRACE(T_ERROR,("ss","Cursor_ResultSet", "ResultSetAlloc returned NULL")); return NULL; } valuep = rs->valuep; width = rs->width; rs->fetchResultCode = OCI_SUCCESS; if (self->flags & LONG_COLUMN && (char) i == self->longcol) { mode = OCI_DYNAMIC_FETCH; lf = (LongFetch *) rs->valuep; longFetchInit(lf); /*valuep = NULL;*/ width = 0x7FFFFFFF; /* Max unsigned long */ rs->indp = &lf->ind; //KMH, 2.8.2005 synchronisation of dynamicFetch with ResultSet rs->rcodep = &lf->rcode; //KMH, 2.8.2005 synchronisation of dynamicFetch with ResultSet } TRACE(T_CALL,("sdAddd", "OCIDefineByPos", i, valuep, width, rs->cdty, mode)); /* Now bind the result set */ /* Docu from OCI: indp (IN/OUT), alenp (IN/OUT), rcodep (OUT): Ignored for dynamic binds. */ status = OCIDefineByPos(self->stmtp, &(rs->defnp), self->errhp, i, valuep, width, rs->cdty, (dvoid *) rs->indp, rs->rlenp, rs->rcodep, mode); TRACE(T_RETURN,("sR", "OCIDefineByPos", status)); if (status != OCI_SUCCESS) { Py_DECREF(rs); Py_DECREF(list); return RaiseOCIError(self->errhp, OCI_HTYPE_ERROR); } if (self->flags & LONG_COLUMN && (char) i == self->longcol) { TRACE(T_CALL,("sA", "OCIDefineDynamic", rs->valuep)); status = OCIDefineDynamic(rs->defnp, self->errhp, (dvoid *) rs->valuep, (OCICallbackDefine) dynamicFetch); TRACE(T_RETURN,("sR", "OCIDefineDynamic", status)); if (status != OCI_SUCCESS) { Py_DECREF(rs); Py_DECREF(list); return RaiseOCIError(self->errhp, OCI_HTYPE_ERROR); } } PyList_Append(list, OBJECT(rs)); Py_DECREF(rs); /* Now that its in the list ... */ } if (self->results != NULL) { Py_DECREF(self->results); } self->results = list; self->current = 0; Py_INCREF(Py_None); TRACE(T_EXIT,("s","Cursor_ResultSet")); return Py_None; } Second Fix: static PyObject *Cursor_fetch(Cursor *self, PyObject *args) { int count = 1; ub4 rcount; int status; ub2 *rlenp; ResultSet *rs; int i; int j; int resetlong = 0; int releaseresults = 0; PyObject *answer; TRACE(T_ENTRY,("sAA", "Cursor_fetch", self, args)); /* bindObject may have bound this cursor, in which case we ** must refetch the description */ if (self->flags & CURSOR_INSPECT) Cursor_getdesc(self); if (!PyArg_ParseTuple(args, "|i", &count)) return NULL; TRACE(T_ARGS,("sd", "Cursor_fetch", count)); if (count < 1 || count > 200) { PyErr_SetString(PyExc_ValueError, "Count out of range"); return NULL; } if (self->flags & LONG_COLUMN) { count = 1; /* Should we raise an error? */ if (self->current != -1) resetlong = 1; } if (self->flags & NO_RESULT) { TRACE((T_PROGRAM|T_ERROR),("ss","Cursor_fetch", "no result set from execute")); PyErr_SetObject(ProgrammingErrorObject, Py_BuildValue("s", "No results available from last execute operation")); return NULL; } if (self->current == -1) if (Cursor_ResultSet(self, count) == NULL) return NULL; /* Set the result widths */ for (i = 0; i < PyList_Size(self->results); i++) { if ((rs = (ResultSet *) PyList_GetItem(self->results, i)) == NULL) return NULL; rlenp = rs->rlenp; for (j = 0; j < rs->size; j++) { *rlenp = (ub2) rs->width; rlenp++; } if (resetlong == 1 && (i+1) == self->longcol) { LongFetch *lf = (LongFetch *) rs->valuep; longFetchRelease(lf); longFetchInit(lf); rs->indp = &lf->ind; //KMH, 2.8.2005 synchronisation of dynamicFetch with ResultSet rs->rcodep = &lf->rcode; //KMH, 2.8.2005 synchronisation of dynamicFetch with ResultSet } } TRACE(T_CALL,("sd", "OCIStmtFetch", count)); Py_BEGIN_ALLOW_THREADS /* ** NB: A fetch of length 0 will cancel the cursor ** ** Do we *need* to cancel the cursor when the Cursor is ** deallocated or will Oracle figure it out when the statement ** handle is released? */ status = OCIStmtFetch(self->stmtp, self->errhp, count, OCI_FETCH_NEXT, OCI_DEFAULT); Py_END_ALLOW_THREADS TRACE(T_RETURN,("sR", "OCIStmtFetch", status)); /* ** Copy the fetch status into each result */ if (status == OCI_SUCCESS_WITH_INFO) { for (i = 0; i < PyList_Size(self->results); i++) { rs = (ResultSet *) PyList_GetItem(self->results, i); rs->fetchResultCode=status; } } if (status == OCI_SUCCESS) { for (i = 0; i < PyList_Size(self->results); i++) { rs = (ResultSet *) PyList_GetItem(self->results, i); rs->fetchResultCode=status; } } TRACE(T_VERBOSE,("sd", "Cursor_fetch status", status)); if (status != OCI_SUCCESS && status != OCI_SUCCESS_WITH_INFO) { text buff[OCI_ERROR_MAXMSG_SIZE]; sb4 errcode; OCIErrorGet(self->errhp, 1, NULL, &errcode, buff, sizeof(buff), OCI_HTYPE_ERROR); /* Oracle errors meaning "end of fetch" ** 1403 is ** 1002 is fetch out of sequence */ TRACE(T_OERROR,("sdS","OCIStmtFetch",errcode,buff)); if (errcode != 1403 && errcode != 1002) {/* Not End of data */ Py_DECREF(self->results); self->results = NULL; self->current = -1; return RaiseOCIError(self->errhp, OCI_HTYPE_ERROR); } releaseresults = 1; } TRACE(T_HCALL,("sAsAs", "OCIAttrGet", self->stmtp, "OCI_HTYPE_STMT", &rcount, "OCI_ATTR_ROW_COUNT")); status = OCIAttrGet((dvoid *) self->stmtp, OCI_HTYPE_STMT, (ub4 *) &rcount, 0, OCI_ATTR_ROW_COUNT, self->errhp); TRACE(T_HRETURN,("sRd", "OCIAttrGet", status, rcount)); if (status == OCI_SUCCESS) { if (self->batchct == -1) self->batchct = 0; self->count = rcount - self->batchct; self->batchct = rcount; } else return RaiseOCIError(self->errhp, OCI_HTYPE_ERROR); answer = self->results; if (!releaseresults) Py_INCREF(answer); else { self->results = NULL; /* Our caller gets our only copy*/ self->current = -1; } TRACE(T_EXIT,("sA", "Cursor_fetch", answer)); return answer; } Klaus Happle -----Urspr?ngliche Nachricht----- Von: zope-db-bounces@zope.org [mailto:zope-db-bounces@zope.org] Im Auftrag von Maciej Wisniowski Gesendet: Freitag, 17. November 2006 17:32 An: Zope-DB@zope.org Betreff: [Zope-DB] [ANN] Modified version of DCOracle2 is available Hi Due to discussion on Zope list and some work I did before I've published modified version of DCOracle2. What is in this version: 1. Bug fixes - StoredProcedures caused deadlocks in database - StoredProcedures caused conflict errors under heavy load removed self._errors reference and added _p_resolveConflict - other I don't remember now 2. Changes Changes are only in python files - DCOracle2 now uses connection pool Pool implementation is based on psycopg but it doesn't use volatile attributes. As a result: - Open/Close button in ZMI works as it should - DCOracle is possibly slower a bit - Ability to reconnect after the connection is broken When Oracle is restarted, connection is closed by firewall etc. Zope will show an error but only once for every broken connection. Second request will cause DCOracle2 to reconnect 3. To do: - Possibly useage of raise ConflictError may cause that there will be no errors shown during reconnect - Pool size attribute may be set via ZMI - Testing... This code is now in use at my company, but not yet in production environment. So far this works with Zope 2.8.x and Oracle9. If somebody knows better place for this code then let me know. Any ideas how should file headers (I mean licences) look? Comments are welcome Code is here: http://code.google.com/p/dcoracle2da/ Should be available via svn with: svn checkout http://dcoracle2da.googlecode.com/svn/trunk/ dcoracle2da THERE IS NO GUARANTEE THAT THIS WILL WORK FOR YOU, SO BE CAREFULL :) -- Maciej Wisniowski _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From dieter at handshake.de Thu Nov 23 14:25:10 2006 From: dieter at handshake.de (Dieter Maurer) Date: Thu Nov 23 14:24:45 2006 Subject: [Zope-DB] dtml-let variables in sql queries In-Reply-To: References: Message-ID: <17765.62870.786301.413103@gargle.gargle.HOWL> Andreas Tille wrote at 2006-11-23 16:06 +0100: > .... >Unfortunately > >does not seem to work transparently in the SQL-Method Right. "ZSQL Method"s take their parameters either from explicitly passed keyword arguments or from the request but not from the DTML namespace. -- Dieter From maciej.wisniowski at coig.katowice.pl Fri Nov 24 04:22:50 2006 From: maciej.wisniowski at coig.katowice.pl (Maciej Wisniowski) Date: Fri Nov 24 04:23:02 2006 Subject: AW: [Zope-DB] [ANN] Modified version of DCOracle2 is available In-Reply-To: References: Message-ID: <4566B9EA.70508@coig.katowice.pl> > you remember my report > > http://mail.zope.org/pipermail/zope/2005-August/160762.html > > of an BUG for the handling of LONGs in DCO2? > In fact I forgot about this... > The consequence of this BUG is stochastic results for LONG fields > > We use an Fix of this BUG: > I've put your code into dco2.c. Thank you very much for these fixes. -- Maciej Wisniowski From t.ceretto at chu-nancy.fr Wed Nov 29 03:15:00 2006 From: t.ceretto at chu-nancy.fr (CERETTO Thierry) Date: Wed Nov 29 03:15:03 2006 Subject: [Zope-DB] Problem wiith dtml-sqltest variable and multiples values into one parametert ??? Message-ID: Hi, (Zope 2.8.6-final, python 2.3.5, win32, ZMySQLDA 2.0.8) I have created a "Z Search Interface" to select some data from MySql table. In "search form" (Page Template), I have created a select field (called "select_keys") to select one or more keys words (from MySQl table). On submit, with javascript, I fill an hidden field called "ref_fiche" where I put a list (JS array) of value select in field "select_keys", for example, value can be : f1 or f1,f4,f2, etc "Search form" use "result_form" which use a "Z SQL Method" where the SQL is write like this : SELECT titre, descriptif, gestionnaire, coord_gest, URL FROM reference_fiche WHERE () This Z SQL Method had one parameter called "ref_fiche". Well, from search form, when I select one key word, all works fine: one result is found and display, but when I select several keys words, SQL doesn't works, I get this Zope message : ********************** SQL used: SELECT titre, descriptif, gestionnaire, coord_gest, URL FROM reference_fiche WHERE (ref_Fiche = 'f1, f4') ********************** Also, I test with "test" tab of "Z SQL method", it's the same, when I put "f1" in parameter field, that's work but if I put "f1,f2" (list) that's doesn't work (I get message above) (alos I tried : "f1","f2" and 'f1','f2', etc, etc, but without success) Zope documentation says about dtml-sqltest variable and multiple argument; http://zope.org/Documentation/Books/ZopeBook/2_6Edition/RelationalDataba ses.stx ********************** multiple A flag indicating whether multiple values may be provided. This lets you test if a column is in a set of variables. For example when name is a list of strings "Bob" , "Billy" , renders to this SQL: name in ("Bob", "Billy"). ********************** but, in Zope message above, the SQL used which I see "(ref_Fiche = 'f1, f4')" and not "ref_Fiche IN ('f1','f4') Why ? It's a bug ? How pass one list parameter ? Any clues (solutions) are welcome, Thank you, Thierry -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.zope.org/pipermail/zope-db/attachments/20061129/13045f57/attachment.htm From cnk+zope at caltech.edu Wed Nov 29 12:53:29 2006 From: cnk+zope at caltech.edu (Cynthia Kiser) Date: Wed Nov 29 12:55:51 2006 Subject: [Zope-DB] Problem wiith dtml-sqltest variable and multiples values into one parametert ??? In-Reply-To: References: Message-ID: <20061129175329.GA19044@sue.caltech.edu> Quoting CERETTO Thierry : > In "search form" (Page Template), I have created a select field (called > "select_keys") to select one or more keys words (from MySQl table). On > submit, with javascript, I fill an hidden field called "ref_fiche" where > I put a list (JS array) of value select in field "select_keys", for > example, value can be : f1 or f1,f4,f2, etc ... > but, in Zope message above, the SQL used which I see "(ref_Fiche = 'f1, > f4')" and not "ref_Fiche IN ('f1','f4') Why ? > > How pass one list parameter ? I can't tell without reading more widely if one could pass a list parameter but the behavior as you describe it indicates that you should not be passing a single variable that contains a list. Instead you should be passing multiple parameters all called ref_Fiche with different values. For example, if this form were to be sent as a GET request, you should send ?ref_Fiche=f1&ref_Fiche=f4 rather than ?ref_Fiche=f1,f4 I think the dtml-sqltest is pulling the variables out of the request object and is seeing a single variable called ref_fiche and so is constructing the sql that is appropriate to a single value. To get it to construct something like "ref_Fiche in (f1,f4)" you will need to have multiple ref_Fiche variables in the request object. From dieter at handshake.de Wed Nov 29 17:08:46 2006 From: dieter at handshake.de (Dieter Maurer) Date: Wed Nov 29 17:08:23 2006 Subject: [Zope-DB] Problem wiith dtml-sqltest variable and multiples values into one parametert ??? In-Reply-To: References: Message-ID: <17774.1262.771070.348708@gargle.gargle.HOWL> CERETTO Thierry wrote at 2006-11-29 09:15 +0100: > ... >Also, I test with "test" tab of "Z SQL method", it's the same, when I >put "f1" in parameter field, that's work but if I put "f1,f2" (list) >that's doesn't work (I get message above) (alos I tried : "f1","f2" and >'f1','f2', etc, etc, but without success) "multiple" expects to get a sequence of objects but HTML/HTTP handles only strings. Either, you must use Python means to convert the string "f1, f2, ..." into a list of strings (e.g. "str.split(', ')"), or use ZPublisher magic (in this concrete case, the ":list" variable suffix) to let ZPublisher perform the type conversion. In your special case, using separate "hidden" fields (one for each list element, all sharing the same name) may be sufficient (as the ":list" is (almost) the default for this case). You find a concise description of ZPublisher's magic suffixes in -- Dieter From javi80mix at gmail.com Thu Nov 30 11:46:27 2006 From: javi80mix at gmail.com (javi lopez) Date: Thu Nov 30 11:46:30 2006 Subject: [Zope-DB] migration script to zforum Message-ID: <929999eb0611300846q3cb5ca2by87f1a1471b8e17c5@mail.gmail.com> hello i am searching a migration script to my DB. I have my DB in xoops and i want create my own zforum, but i don?t want to miss a thing form my DB. Do you know a script xoops to zforum????thanks