Re: [Zope] MySQL-python-1.2.2 ImportError

2009-01-21 Thread Michael Backhaus
Well, I guess it was my bet ... solaris uses 'crle' for the ld
configuration. I included the mysql-lib directory and it seems to work
now.

On Wed, 2009-01-21 at 06:20 +0530, Chetan Kumar wrote:
> On Wed, Jan 21, 2009 at 3:19 AM, SolidEther  wrote:
> > ImportError: ld.so.1: python: fatal: libmysqlclient_r.so.16: open
> > failed: No such file or directory
> 
> Take care to compile MySQL with thread-safe option.
> Cheers

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] mysql and LOAD DATA INFILE

2008-10-15 Thread Andreas Jung

On 15.10.2008 13:16 Uhr, [EMAIL PROTECTED] wrote:

hello everybody!

this is a 50%zope and 50%mysql question..hope somebody here will help me..:-)

in PC1: are running a mysql and zope+Plone server. A zsql method imports a csv
file into mysql using a LOAD DATA LOCAL INFILE and all runs OK when the file
is in the PC1 filesystem.

I know that "LOCAL" is from the mysql server's point of view, in this
case "LOCAL" should mean "where the mysql client is running" (the zope web
server)

Is there a way to let a remote Plone user (on a remote host) to enter his
local file into the remote mysql server?

I guess that the issue is entirely on the mysql side, but hope that zope will
offer some kind of solution.



Not sure what the background of your question is. According to the docs: 
LOAD DATA INLINE will read a file from the client host. So you must 
ensure that the data file is available on the machine where Plone/Zope 
is running. Where is the problem with that?


-aj
begin:vcard
fn:Andreas Jung
n:Jung;Andreas
org:ZOPYX Ltd. & Co. KG
adr;quoted-printable:;;Charlottenstr. 37/1;T=C3=BCbingen;;72070;Germany
email;internet:[EMAIL PROTECTED]
title:CEO
tel;work:+49-7071-793376
tel;fax:+49-7071-7936840
tel;home:+49-7071-793257
x-mozilla-html:FALSE
url:www.zopyx.com
version:2.1
end:vcard

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL reconnects on zope application level

2008-07-17 Thread Jonas Meurer
On 16/07/2008 Peter Bengtsson wrote:
> I don't have an easy answer but if you do dig into Andy's code and try
> to implement this, I would suggest you look at the ZPsycopgDA code
> perhaps and look for inspiration since I think that one works much
> better.

Thanks, but finally I found an easier solution :-)

the 3.0 beta1 of ZMySQLDA seems to have this fixed. It doesn't allow to
configure automatic reconnects, but it implements them defaultly.

thanks for your help,

greetings,
 jonas
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL reconnects on zope application level

2008-07-16 Thread Peter Bengtsson
I don't have an easy answer but if you do dig into Andy's code and try
to implement this, I would suggest you look at the ZPsycopgDA code
perhaps and look for inspiration since I think that one works much
better.


2008/7/16 Jonas <[EMAIL PROTECTED]>:
> Hello,
>
> On several zope 2.10.6 instances we discovered issues with database
> connections to MySQL. Apparently MySQL seems to not automaticly
> reconnect connections with a timeout since version 5.0.3 due to issues
> with transactions.
>
> Until now, mysql-python was patched to restore that behaviour to
> automatically reconnect timeouted connections, but that is not the case
> anymore either.
>
> So from now on the database reconnects need to be done from zope
> applications on their own. Unfortunately the ZMySQLda adapter by Andy
> Dustman doesn't implement such a functionality.
>
> I cannot imagine that we are the only ones who discover this problem. Is
> there an easy way to implement automatic reconnects for Z MySQL Database
> Connections on zope application level?
>
> greetings, and thanks in advance,
>  jonas
> ___
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
>



-- 
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL-python-1.2.2 breaks compiling on Mac OS X 10.5 (Andy Dustman?)

2008-02-21 Thread Hugo Ramos
Hi Tino,

Is "I've never used Postgres before and all my web life experience is
MySQL based" reason enough?
:-)

Thanks
Hugo


On Thu, Feb 21, 2008 at 3:31 PM, Tino Wildenhain <[EMAIL PROTECTED]> wrote:
> Hugo Ramos wrote:
>  > Well,
>  >
>  > I went googling for this error... Google gives 1 (one) answer!!! The
>  > worst part is that it's related to django and mod_python.
>  >
>  > I guess nobody solved this yet... I'll have to go back to OS X 10.4 
> (Tiger).
>
>  You could also forward to Postgres :-) Unless you have a very specific
>  need for mysql...
>
>  Regards
>  Tino
>
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL-python-1.2.2 breaks compiling on Mac OS X 10.5 (Andy Dustman?)

2008-02-21 Thread Tino Wildenhain

Hugo Ramos wrote:

Well,

I went googling for this error... Google gives 1 (one) answer!!! The
worst part is that it's related to django and mod_python.

I guess nobody solved this yet... I'll have to go back to OS X 10.4 (Tiger).


You could also forward to Postgres :-) Unless you have a very specific
need for mysql...

Regards
Tino
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL-python-1.2.2 breaks compiling on Mac OS X 10.5 (Andy Dustman?)

2008-02-21 Thread David Pratt
Hi Hugo. Yes, that's true but of course you have to consider all of the 
other frameworks that apple has already put on your machine. Much of the 
problem will come when linking the libraries when compiling. So in fact 
it is a bigger issue and requires much of the base software to 
recompiled using macports or on your own for a sound development 
machine. You can of course recompile these to create a framework build 
for your own architecture.


You probably just need to keep in mind that mac is really only just 
FreeBSD/Darwin so things will compile in a normal mode without anything 
'universal' involved. I just takes some effort.


Regards,
David

Hugo Ramos wrote:

Hello David,

It makes sense to me! The only thing I was using as a binary was
Python 2.4.4 universal binary.
I guess if I was using Python from the source it should work then.

Thank you very much.

Hugo


On Thu, Feb 21, 2008 at 3:01 AM, David Pratt <[EMAIL PROTECTED]> wrote:

Hi Hugo. I believe 'file is not of required architecture' may be the
 clue here. Ever since mac went to universal binaries, folks with ppc
 have been having trouble since it is compiled with i386 arch flags and
 vice versa for folks with intel macs (with ppc arch flags). The only way
 to get around this is to compile a universal build, use universal
 binaries, or build for your own architecture. There is a large amount of
 software out there that does not do the right thing.

 For myself, I build my own software including python and I try and keep
 away from the universal insanity. On a mac, many folks use macports
 without the universal build. If you choose to build your own software,
 you can place it in the /opt directory to prevent it from affecting your
 system software. This is where your macports software will go if you use
 it. You will also need to modify your path to ensure that your compiled
 software is obtained over system software.

 I see that your issue was solved with a universal build. This probably
 just confirms what I have written. This may be alright until you run
 into the next snag with something else you need to compile. Personally,
 I got tired of the consistent problems trying to build software with the
 universal python.

 Regards,
 David



 Hugo Ramos wrote:
 > Hello Chetan,
 >
 > Well thank you very much! I must be very tired to forget to compile
 > MySQL without --enable-thread-safe-client !!!
 > It seems that MySQL-python now compiles with a warning:
 >
 > ld: warning in /usr/local/mysql/lib/mysql/libmysqlclient_r.dylib, file
 > is not of required architecture
 >
 > But when I try to import _mysql in Python 2.4.4 shell it seems to
 > import the module with no errors.
 >
 > After that when I try to import ZMySQLDA 2.0.8 in Zope 2.10.5 I
 > receive the following error:
 >
 > ===
 > 2008-02-20 11:41:52 ERROR Application Could not import Products.ZMySQLDA
 > Traceback (most recent call last):
 >   File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line
 > 709, in import_product
 > product=__import__(pname, global_dict, global_dict, silly)
 >   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py",
 > line 91, in ?
 > import DA
 >   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py", line 92, 
in ?
 > from db import DB
 >   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py", line 89, 
in ?
 > import _mysql
 >   File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in ?
 >   File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in __bootstrap__
 > ImportError: Inappropriate file type for dynamic loading
 > Traceback (most recent call last):
 >   File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py", line 56, in ?
 > run()
 >   File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py", line 21, in 
run
 > starter.prepare()
 >   File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py",
 > line 102, in prepare
 > self.startZope()
 >   File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py",
 > line 278, in startZope
 > Zope2.startup()
 >   File "/usr/local/zope2.10.5/lib/python/Zope2/__init__.py", line 47, in 
startup
 > _startup()
 >   File "/usr/local/zope2.10.5/lib/python/Zope2/App/startup.py", line
 > 45, in startup
 > OFS.Application.import_products()
 >   File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line
 > 686, in import_products
 > import_product(product_dir, product_name, raise_exc=debug_mode)
 >   File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line
 > 709, in import_product
 > product=__import__(pname, global_dict, global_dict, silly)
 >   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py",
 > line 91, in ?
 > import DA
 >   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py", line 92, 
in ?
 > from db import DB
 >   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py", line 89, 
in ?
 > import _my

Re: [Zope] MySQL-python-1.2.2 breaks compiling on Mac OS X 10.5 (Andy Dustman?)

2008-02-21 Thread Hugo Ramos
Hello David,

It makes sense to me! The only thing I was using as a binary was
Python 2.4.4 universal binary.
I guess if I was using Python from the source it should work then.

Thank you very much.

Hugo


On Thu, Feb 21, 2008 at 3:01 AM, David Pratt <[EMAIL PROTECTED]> wrote:
> Hi Hugo. I believe 'file is not of required architecture' may be the
>  clue here. Ever since mac went to universal binaries, folks with ppc
>  have been having trouble since it is compiled with i386 arch flags and
>  vice versa for folks with intel macs (with ppc arch flags). The only way
>  to get around this is to compile a universal build, use universal
>  binaries, or build for your own architecture. There is a large amount of
>  software out there that does not do the right thing.
>
>  For myself, I build my own software including python and I try and keep
>  away from the universal insanity. On a mac, many folks use macports
>  without the universal build. If you choose to build your own software,
>  you can place it in the /opt directory to prevent it from affecting your
>  system software. This is where your macports software will go if you use
>  it. You will also need to modify your path to ensure that your compiled
>  software is obtained over system software.
>
>  I see that your issue was solved with a universal build. This probably
>  just confirms what I have written. This may be alright until you run
>  into the next snag with something else you need to compile. Personally,
>  I got tired of the consistent problems trying to build software with the
>  universal python.
>
>  Regards,
>  David
>
>
>
>  Hugo Ramos wrote:
>  > Hello Chetan,
>  >
>  > Well thank you very much! I must be very tired to forget to compile
>  > MySQL without --enable-thread-safe-client !!!
>  > It seems that MySQL-python now compiles with a warning:
>  >
>  > ld: warning in /usr/local/mysql/lib/mysql/libmysqlclient_r.dylib, file
>  > is not of required architecture
>  >
>  > But when I try to import _mysql in Python 2.4.4 shell it seems to
>  > import the module with no errors.
>  >
>  > After that when I try to import ZMySQLDA 2.0.8 in Zope 2.10.5 I
>  > receive the following error:
>  >
>  > ===
>  > 2008-02-20 11:41:52 ERROR Application Could not import Products.ZMySQLDA
>  > Traceback (most recent call last):
>  >   File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line
>  > 709, in import_product
>  > product=__import__(pname, global_dict, global_dict, silly)
>  >   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py",
>  > line 91, in ?
>  > import DA
>  >   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py", line 92, 
> in ?
>  > from db import DB
>  >   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py", line 89, 
> in ?
>  > import _mysql
>  >   File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in ?
>  >   File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in 
> __bootstrap__
>  > ImportError: Inappropriate file type for dynamic loading
>  > Traceback (most recent call last):
>  >   File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py", line 56, 
> in ?
>  > run()
>  >   File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py", line 21, 
> in run
>  > starter.prepare()
>  >   File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py",
>  > line 102, in prepare
>  > self.startZope()
>  >   File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py",
>  > line 278, in startZope
>  > Zope2.startup()
>  >   File "/usr/local/zope2.10.5/lib/python/Zope2/__init__.py", line 47, in 
> startup
>  > _startup()
>  >   File "/usr/local/zope2.10.5/lib/python/Zope2/App/startup.py", line
>  > 45, in startup
>  > OFS.Application.import_products()
>  >   File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line
>  > 686, in import_products
>  > import_product(product_dir, product_name, raise_exc=debug_mode)
>  >   File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line
>  > 709, in import_product
>  > product=__import__(pname, global_dict, global_dict, silly)
>  >   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py",
>  > line 91, in ?
>  > import DA
>  >   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py", line 92, 
> in ?
>  > from db import DB
>  >   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py", line 89, 
> in ?
>  > import _mysql
>  >   File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in ?
>  >   File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in 
> __bootstrap__
>  > ImportError: Inappropriate file type for dynamic loading
>  > ===
>  >
>  > Any ideas?
>  >
>  > ps: I'm posting this to zope list because I'm sure there is more
>  > people with this problem.
>  >
>  >
>  > tia
>  >
>  > Hugo
>  >
>  >
>  > On Feb 20, 2008 10:35 AM, Chetan Kumar <[EMAIL PROTECTED]

Re: [Zope] MySQL-python-1.2.2 breaks compiling on Mac OS X 10.5 (Andy Dustman?)

2008-02-20 Thread David Pratt
Hi Hugo. I believe 'file is not of required architecture' may be the 
clue here. Ever since mac went to universal binaries, folks with ppc 
have been having trouble since it is compiled with i386 arch flags and 
vice versa for folks with intel macs (with ppc arch flags). The only way 
to get around this is to compile a universal build, use universal 
binaries, or build for your own architecture. There is a large amount of 
software out there that does not do the right thing.


For myself, I build my own software including python and I try and keep 
away from the universal insanity. On a mac, many folks use macports 
without the universal build. If you choose to build your own software, 
you can place it in the /opt directory to prevent it from affecting your 
system software. This is where your macports software will go if you use 
it. You will also need to modify your path to ensure that your compiled 
software is obtained over system software.


I see that your issue was solved with a universal build. This probably 
just confirms what I have written. This may be alright until you run 
into the next snag with something else you need to compile. Personally, 
I got tired of the consistent problems trying to build software with the 
universal python.


Regards,
David

Hugo Ramos wrote:

Hello Chetan,

Well thank you very much! I must be very tired to forget to compile
MySQL without --enable-thread-safe-client !!!
It seems that MySQL-python now compiles with a warning:

ld: warning in /usr/local/mysql/lib/mysql/libmysqlclient_r.dylib, file
is not of required architecture

But when I try to import _mysql in Python 2.4.4 shell it seems to
import the module with no errors.

After that when I try to import ZMySQLDA 2.0.8 in Zope 2.10.5 I
receive the following error:

===
2008-02-20 11:41:52 ERROR Application Could not import Products.ZMySQLDA
Traceback (most recent call last):
  File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line
709, in import_product
product=__import__(pname, global_dict, global_dict, silly)
  File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py",
line 91, in ?
import DA
  File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py", line 92, in ?
from db import DB
  File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py", line 89, in ?
import _mysql
  File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in ?
  File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in __bootstrap__
ImportError: Inappropriate file type for dynamic loading
Traceback (most recent call last):
  File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py", line 56, in ?
run()
  File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py", line 21, in run
starter.prepare()
  File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py",
line 102, in prepare
self.startZope()
  File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py",
line 278, in startZope
Zope2.startup()
  File "/usr/local/zope2.10.5/lib/python/Zope2/__init__.py", line 47, in startup
_startup()
  File "/usr/local/zope2.10.5/lib/python/Zope2/App/startup.py", line
45, in startup
OFS.Application.import_products()
  File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line
686, in import_products
import_product(product_dir, product_name, raise_exc=debug_mode)
  File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line
709, in import_product
product=__import__(pname, global_dict, global_dict, silly)
  File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py",
line 91, in ?
import DA
  File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py", line 92, in ?
from db import DB
  File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py", line 89, in ?
import _mysql
  File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in ?
  File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in __bootstrap__
ImportError: Inappropriate file type for dynamic loading
===

Any ideas?

ps: I'm posting this to zope list because I'm sure there is more
people with this problem.


tia

Hugo


On Feb 20, 2008 10:35 AM, Chetan Kumar <[EMAIL PROTECTED]> wrote:

Hello
I understand.
If I could take the risk of "telling-the-obvious" what you need to do
is to recompile mysql so that mysqlclient_r libraries are also
created.
--enable-thread-safe-client is to be used while configuring the mysql
installation.
If that is done already, the LD_LIBRARY_PATH (or equivalent in your
case) if to set appropriately so that lmysqlclient_r is available for
linking.
Good luck
Chetan






___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL-python-1.2.2 breaks compiling on Mac OS X 10.5 (Andy Dustman?)

2008-02-20 Thread Hugo Ramos
Man...

I should buy you a drink at Lisbon when you decide to come here!!! :-)
The binary package works fine now!

I just wish someone would answer about the compilation warning and
import error in Zope.


Thank you very much
Really appreciated

Hugo


On Wed, Feb 20, 2008 at 8:47 PM, Giampiero Benvenuti
<[EMAIL PROTECTED]> wrote:
> does it work?
>
>
>
>  On Feb 20, 2008, at 10:07 AM, Hugo Ramos wrote:
>
>  > Forget it... Just found the file at:
>  > http://pythonmac.org/packages/py24-fat/index.html
>  >
>  >
>  > Thanks a lot!
>  > Hugo
>  >
>  >
>  > On Feb 20, 2008 5:57 PM, Hugo Ramos <[EMAIL PROTECTED]> wrote:
>  >> Where did you get that file? MySQL-Python at sourceforge?
>  >>
>  >>
>  >> Thanks
>  >>
>  >>
>  >> On Feb 20, 2008 5:28 PM, Giampiero Benvenuti
>  >>
>  >> <[EMAIL PROTECTED]> wrote:
>  >>> I used MySQL_Python-1.2.1_p2-py2.4-macosx10.4.zip with 10.5 and It
>  >>> works
>  >>> just fine.
>  >>>
>  >>> Giampiero
>  >>>
>  >>>
>  >>>
>  >>> On Feb 20, 2008, at 8:52 AM, Hugo Ramos wrote:
>  >>>
>  >>>
>  >>> Well,
>  >>>
>  >>> I went googling for this error... Google gives 1 (one) answer!!! The
>  >>> worst part is that it's related to django and mod_python.
>  >>>
>  >>> I guess nobody solved this yet... I'll have to go back to OS X
>  >>> 10.4 (Tiger).
>  >>>
>  >>> omg...
>  >>>
>  >>>
>  >>> Thanks
>  >>> Hugo
>  >>>
>  >>>
>  >>> On Feb 20, 2008 12:31 PM, Hugo Ramos <[EMAIL PROTECTED]> wrote:
>  >>> Hello Chetan,
>  >>>
>  >>> Well thank you very much! I must be very tired to forget to compile
>  >>> MySQL without --enable-thread-safe-client !!!
>  >>> It seems that MySQL-python now compiles with a warning:
>  >>>
>  >>> ld: warning in /usr/local/mysql/lib/mysql/libmysqlclient_r.dylib,
>  >>> file
>  >>> is not of required architecture
>  >>>
>  >>> But when I try to import _mysql in Python 2.4.4 shell it seems to
>  >>> import the module with no errors.
>  >>>
>  >>> After that when I try to import ZMySQLDA 2.0.8 in Zope 2.10.5 I
>  >>> receive the following error:
>  >>>
>  >>> ===
>  >>> 2008-02-20 11:41:52 ERROR Application Could not import
>  >>> Products.ZMySQLDA
>  >>> Traceback (most recent call last):
>  >>>  File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line
>  >>> 709, in import_product
>  >>>product=__import__(pname, global_dict, global_dict, silly)
>  >>>  File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/
>  >>> __init__.py",
>  >>> line 91, in ?
>  >>>import DA
>  >>>  File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py",
>  >>> line 92,
>  >>> in ?
>  >>>from db import DB
>  >>>  File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py",
>  >>> line 89,
>  >>> in ?
>  >>>import _mysql
>  >>>  File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in ?
>  >>>  File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in
>  >>> __bootstrap__
>  >>> ImportError: Inappropriate file type for dynamic loading
>  >>> Traceback (most recent call last):
>  >>>  File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py",
>  >>> line 56, in
>  >>> ?
>  >>>run()
>  >>>  File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py",
>  >>> line 21, in
>  >>> run
>  >>>starter.prepare()
>  >>>  File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py",
>  >>> line 102, in prepare
>  >>>self.startZope()
>  >>>  File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py",
>  >>> line 278, in startZope
>  >>>Zope2.startup()
>  >>>  File "/usr/local/zope2.10.5/lib/python/Zope2/__init__.py", line
>  >>> 47, in
>  >>> startup
>  >>>_startup()
>  >>>  File "/usr/local/zope2.10.5/lib/python/Zope2/App/startup.py", line
>  >>> 45, in startup
>  >>>OFS.Application.import_products()
>  >>>  File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line
>  >>> 686, in import_products
>  >>>import_product(product_dir, product_name, raise_exc=debug_mode)
>  >>>  File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line
>  >>> 709, in import_product
>  >>>product=__import__(pname, global_dict, global_dict, silly)
>  >>>  File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/
>  >>> __init__.py",
>  >>> line 91, in ?
>  >>>import DA
>  >>>  File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py",
>  >>> line 92,
>  >>> in ?
>  >>>from db import DB
>  >>>  File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py",
>  >>> line 89,
>  >>> in ?
>  >>>import _mysql
>  >>>  File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in ?
>  >>>  File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in
>  >>> __bootstrap__
>  >>> ImportError: Inappropriate file type for dynamic loading
>  >>> ===
>  >>>
>  >>> Any ideas?
>  >>>
>  >>> ps: I'm posting this to zope list because I'm sure there is more
>  >>> people with this problem.
>  >>>
>  >>>
>  >>> tia
>  >>>
>  >>> Hugo
>  >>>
>  >>>
>  >>>
>  >>> On Feb 20, 2008 1

Re: [Zope] MySQL-python-1.2.2 breaks compiling on Mac OS X 10.5 (Andy Dustman?)

2008-02-20 Thread Hugo Ramos
Forget it... Just found the file at:
http://pythonmac.org/packages/py24-fat/index.html


Thanks a lot!
Hugo


On Feb 20, 2008 5:57 PM, Hugo Ramos <[EMAIL PROTECTED]> wrote:
> Where did you get that file? MySQL-Python at sourceforge?
>
>
> Thanks
>
>
> On Feb 20, 2008 5:28 PM, Giampiero Benvenuti
>
> <[EMAIL PROTECTED]> wrote:
> > I used MySQL_Python-1.2.1_p2-py2.4-macosx10.4.zip with 10.5 and It works
> > just fine.
> >
> > Giampiero
> >
> >
> >
> > On Feb 20, 2008, at 8:52 AM, Hugo Ramos wrote:
> >
> >
> > Well,
> >
> > I went googling for this error... Google gives 1 (one) answer!!! The
> > worst part is that it's related to django and mod_python.
> >
> > I guess nobody solved this yet... I'll have to go back to OS X 10.4 (Tiger).
> >
> > omg...
> >
> >
> > Thanks
> > Hugo
> >
> >
> > On Feb 20, 2008 12:31 PM, Hugo Ramos <[EMAIL PROTECTED]> wrote:
> > Hello Chetan,
> >
> > Well thank you very much! I must be very tired to forget to compile
> > MySQL without --enable-thread-safe-client !!!
> > It seems that MySQL-python now compiles with a warning:
> >
> > ld: warning in /usr/local/mysql/lib/mysql/libmysqlclient_r.dylib, file
> > is not of required architecture
> >
> > But when I try to import _mysql in Python 2.4.4 shell it seems to
> > import the module with no errors.
> >
> > After that when I try to import ZMySQLDA 2.0.8 in Zope 2.10.5 I
> > receive the following error:
> >
> > ===
> > 2008-02-20 11:41:52 ERROR Application Could not import Products.ZMySQLDA
> > Traceback (most recent call last):
> >   File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line
> > 709, in import_product
> > product=__import__(pname, global_dict, global_dict, silly)
> >   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py",
> > line 91, in ?
> > import DA
> >   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py", line 92,
> > in ?
> > from db import DB
> >   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py", line 89,
> > in ?
> > import _mysql
> >   File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in ?
> >   File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in __bootstrap__
> > ImportError: Inappropriate file type for dynamic loading
> > Traceback (most recent call last):
> >   File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py", line 56, in
> > ?
> > run()
> >   File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py", line 21, in
> > run
> > starter.prepare()
> >   File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py",
> > line 102, in prepare
> > self.startZope()
> >   File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py",
> > line 278, in startZope
> > Zope2.startup()
> >   File "/usr/local/zope2.10.5/lib/python/Zope2/__init__.py", line 47, in
> > startup
> > _startup()
> >   File "/usr/local/zope2.10.5/lib/python/Zope2/App/startup.py", line
> > 45, in startup
> > OFS.Application.import_products()
> >   File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line
> > 686, in import_products
> > import_product(product_dir, product_name, raise_exc=debug_mode)
> >   File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line
> > 709, in import_product
> > product=__import__(pname, global_dict, global_dict, silly)
> >   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py",
> > line 91, in ?
> > import DA
> >   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py", line 92,
> > in ?
> > from db import DB
> >   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py", line 89,
> > in ?
> > import _mysql
> >   File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in ?
> >   File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in __bootstrap__
> > ImportError: Inappropriate file type for dynamic loading
> > ===
> >
> > Any ideas?
> >
> > ps: I'm posting this to zope list because I'm sure there is more
> > people with this problem.
> >
> >
> > tia
> >
> > Hugo
> >
> >
> >
> > On Feb 20, 2008 10:35 AM, Chetan Kumar <[EMAIL PROTECTED]> wrote:
> >
> > Hello
> >
> > I understand.
> >
> > If I could take the risk of "telling-the-obvious" what you need to do
> >
> > is to recompile mysql so that mysqlclient_r libraries are also
> >
> > created.
> >
> > --enable-thread-safe-client is to be used while configuring the mysql
> >
> > installation.
> >
> > If that is done already, the LD_LIBRARY_PATH (or equivalent in your
> >
> > case) if to set appropriately so that lmysqlclient_r is available for
> >
> > linking.
> >
> > Good luck
> >
> > Chetan
> >
> >
> >
> >
> >
> > --
> > Hugo Ramos - [EMAIL PROTECTED]
> > IT Project Manager
> >
> > ~~ @ ~~
> > http://www.orkut.com/Profile.aspx?uid=10082105466310142690
> > http://otuggapoesia.blogspot.com/
> > http://otugga.blogspot.com/
> >
> >
> >
> >
> > --
> > Hugo Ramos - [EMAIL PROTECTED]
> > IT Project Ma

Re: [Zope] MySQL-python-1.2.2 breaks compiling on Mac OS X 10.5 (Andy Dustman?)

2008-02-20 Thread Hugo Ramos
Where did you get that file? MySQL-Python at sourceforge?


Thanks


On Feb 20, 2008 5:28 PM, Giampiero Benvenuti
<[EMAIL PROTECTED]> wrote:
> I used MySQL_Python-1.2.1_p2-py2.4-macosx10.4.zip with 10.5 and It works
> just fine.
>
> Giampiero
>
>
>
> On Feb 20, 2008, at 8:52 AM, Hugo Ramos wrote:
>
>
> Well,
>
> I went googling for this error... Google gives 1 (one) answer!!! The
> worst part is that it's related to django and mod_python.
>
> I guess nobody solved this yet... I'll have to go back to OS X 10.4 (Tiger).
>
> omg...
>
>
> Thanks
> Hugo
>
>
> On Feb 20, 2008 12:31 PM, Hugo Ramos <[EMAIL PROTECTED]> wrote:
> Hello Chetan,
>
> Well thank you very much! I must be very tired to forget to compile
> MySQL without --enable-thread-safe-client !!!
> It seems that MySQL-python now compiles with a warning:
>
> ld: warning in /usr/local/mysql/lib/mysql/libmysqlclient_r.dylib, file
> is not of required architecture
>
> But when I try to import _mysql in Python 2.4.4 shell it seems to
> import the module with no errors.
>
> After that when I try to import ZMySQLDA 2.0.8 in Zope 2.10.5 I
> receive the following error:
>
> ===
> 2008-02-20 11:41:52 ERROR Application Could not import Products.ZMySQLDA
> Traceback (most recent call last):
>   File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line
> 709, in import_product
> product=__import__(pname, global_dict, global_dict, silly)
>   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py",
> line 91, in ?
> import DA
>   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py", line 92,
> in ?
> from db import DB
>   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py", line 89,
> in ?
> import _mysql
>   File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in ?
>   File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in __bootstrap__
> ImportError: Inappropriate file type for dynamic loading
> Traceback (most recent call last):
>   File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py", line 56, in
> ?
> run()
>   File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py", line 21, in
> run
> starter.prepare()
>   File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py",
> line 102, in prepare
> self.startZope()
>   File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py",
> line 278, in startZope
> Zope2.startup()
>   File "/usr/local/zope2.10.5/lib/python/Zope2/__init__.py", line 47, in
> startup
> _startup()
>   File "/usr/local/zope2.10.5/lib/python/Zope2/App/startup.py", line
> 45, in startup
> OFS.Application.import_products()
>   File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line
> 686, in import_products
> import_product(product_dir, product_name, raise_exc=debug_mode)
>   File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line
> 709, in import_product
> product=__import__(pname, global_dict, global_dict, silly)
>   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py",
> line 91, in ?
> import DA
>   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py", line 92,
> in ?
> from db import DB
>   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py", line 89,
> in ?
> import _mysql
>   File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in ?
>   File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in __bootstrap__
> ImportError: Inappropriate file type for dynamic loading
> ===
>
> Any ideas?
>
> ps: I'm posting this to zope list because I'm sure there is more
> people with this problem.
>
>
> tia
>
> Hugo
>
>
>
> On Feb 20, 2008 10:35 AM, Chetan Kumar <[EMAIL PROTECTED]> wrote:
>
> Hello
>
> I understand.
>
> If I could take the risk of "telling-the-obvious" what you need to do
>
> is to recompile mysql so that mysqlclient_r libraries are also
>
> created.
>
> --enable-thread-safe-client is to be used while configuring the mysql
>
> installation.
>
> If that is done already, the LD_LIBRARY_PATH (or equivalent in your
>
> case) if to set appropriately so that lmysqlclient_r is available for
>
> linking.
>
> Good luck
>
> Chetan
>
>
>
>
>
> --
> Hugo Ramos - [EMAIL PROTECTED]
> IT Project Manager
>
> ~~ @ ~~
> http://www.orkut.com/Profile.aspx?uid=10082105466310142690
> http://otuggapoesia.blogspot.com/
> http://otugga.blogspot.com/
>
>
>
>
> --
> Hugo Ramos - [EMAIL PROTECTED]
> IT Project Manager
>
> ~~ @ ~~
> http://www.orkut.com/Profile.aspx?uid=10082105466310142690
> http://otuggapoesia.blogspot.com/
> http://otugga.blogspot.com/
> ___
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
>
>
>
_

Re: [Zope] MySQL-python-1.2.2 breaks compiling on Mac OS X 10.5 (Andy Dustman?)

2008-02-20 Thread Hugo Ramos
Well,

I went googling for this error... Google gives 1 (one) answer!!! The
worst part is that it's related to django and mod_python.

I guess nobody solved this yet... I'll have to go back to OS X 10.4 (Tiger).

omg...


Thanks
Hugo


On Feb 20, 2008 12:31 PM, Hugo Ramos <[EMAIL PROTECTED]> wrote:
> Hello Chetan,
>
> Well thank you very much! I must be very tired to forget to compile
> MySQL without --enable-thread-safe-client !!!
> It seems that MySQL-python now compiles with a warning:
>
> ld: warning in /usr/local/mysql/lib/mysql/libmysqlclient_r.dylib, file
> is not of required architecture
>
> But when I try to import _mysql in Python 2.4.4 shell it seems to
> import the module with no errors.
>
> After that when I try to import ZMySQLDA 2.0.8 in Zope 2.10.5 I
> receive the following error:
>
> ===
> 2008-02-20 11:41:52 ERROR Application Could not import Products.ZMySQLDA
> Traceback (most recent call last):
>   File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line
> 709, in import_product
> product=__import__(pname, global_dict, global_dict, silly)
>   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py",
> line 91, in ?
> import DA
>   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py", line 92, in 
> ?
> from db import DB
>   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py", line 89, in 
> ?
> import _mysql
>   File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in ?
>   File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in __bootstrap__
> ImportError: Inappropriate file type for dynamic loading
> Traceback (most recent call last):
>   File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py", line 56, in ?
> run()
>   File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py", line 21, in 
> run
> starter.prepare()
>   File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py",
> line 102, in prepare
> self.startZope()
>   File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py",
> line 278, in startZope
> Zope2.startup()
>   File "/usr/local/zope2.10.5/lib/python/Zope2/__init__.py", line 47, in 
> startup
> _startup()
>   File "/usr/local/zope2.10.5/lib/python/Zope2/App/startup.py", line
> 45, in startup
> OFS.Application.import_products()
>   File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line
> 686, in import_products
> import_product(product_dir, product_name, raise_exc=debug_mode)
>   File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line
> 709, in import_product
> product=__import__(pname, global_dict, global_dict, silly)
>   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py",
> line 91, in ?
> import DA
>   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py", line 92, in 
> ?
> from db import DB
>   File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py", line 89, in 
> ?
> import _mysql
>   File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in ?
>   File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in __bootstrap__
> ImportError: Inappropriate file type for dynamic loading
> ===
>
> Any ideas?
>
> ps: I'm posting this to zope list because I'm sure there is more
> people with this problem.
>
>
> tia
>
> Hugo
>
>
>
> On Feb 20, 2008 10:35 AM, Chetan Kumar <[EMAIL PROTECTED]> wrote:
> > Hello
> > I understand.
> > If I could take the risk of "telling-the-obvious" what you need to do
> > is to recompile mysql so that mysqlclient_r libraries are also
> > created.
> > --enable-thread-safe-client is to be used while configuring the mysql
> > installation.
> > If that is done already, the LD_LIBRARY_PATH (or equivalent in your
> > case) if to set appropriately so that lmysqlclient_r is available for
> > linking.
> > Good luck
> > Chetan
> >
>
>
>
> --
> Hugo Ramos - [EMAIL PROTECTED]
> IT Project Manager
>
> ~~ @ ~~
> http://www.orkut.com/Profile.aspx?uid=10082105466310142690
> http://otuggapoesia.blogspot.com/
> http://otugga.blogspot.com/
>



-- 
Hugo Ramos - [EMAIL PROTECTED]
IT Project Manager

~~ @ ~~
http://www.orkut.com/Profile.aspx?uid=10082105466310142690
http://otuggapoesia.blogspot.com/
http://otugga.blogspot.com/
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL-python-1.2.2 breaks compiling on Mac OS X 10.5 (Andy Dustman?)

2008-02-20 Thread Hugo Ramos
Hello Chetan,

Well thank you very much! I must be very tired to forget to compile
MySQL without --enable-thread-safe-client !!!
It seems that MySQL-python now compiles with a warning:

ld: warning in /usr/local/mysql/lib/mysql/libmysqlclient_r.dylib, file
is not of required architecture

But when I try to import _mysql in Python 2.4.4 shell it seems to
import the module with no errors.

After that when I try to import ZMySQLDA 2.0.8 in Zope 2.10.5 I
receive the following error:

===
2008-02-20 11:41:52 ERROR Application Could not import Products.ZMySQLDA
Traceback (most recent call last):
  File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line
709, in import_product
product=__import__(pname, global_dict, global_dict, silly)
  File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py",
line 91, in ?
import DA
  File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py", line 92, in ?
from db import DB
  File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py", line 89, in ?
import _mysql
  File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in ?
  File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in __bootstrap__
ImportError: Inappropriate file type for dynamic loading
Traceback (most recent call last):
  File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py", line 56, in ?
run()
  File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/run.py", line 21, in run
starter.prepare()
  File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py",
line 102, in prepare
self.startZope()
  File "/usr/local/zope2.10.5/lib/python/Zope2/Startup/__init__.py",
line 278, in startZope
Zope2.startup()
  File "/usr/local/zope2.10.5/lib/python/Zope2/__init__.py", line 47, in startup
_startup()
  File "/usr/local/zope2.10.5/lib/python/Zope2/App/startup.py", line
45, in startup
OFS.Application.import_products()
  File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line
686, in import_products
import_product(product_dir, product_name, raise_exc=debug_mode)
  File "/usr/local/zope2.10.5/lib/python/OFS/Application.py", line
709, in import_product
product=__import__(pname, global_dict, global_dict, silly)
  File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/__init__.py",
line 91, in ?
import DA
  File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/DA.py", line 92, in ?
from db import DB
  File "/usr/local/zope2.10.5/instance1/Products/ZMySQLDA/db.py", line 89, in ?
import _mysql
  File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 7, in ?
  File "build/bdist.macosx-10.3-fat/egg/_mysql.py", line 6, in __bootstrap__
ImportError: Inappropriate file type for dynamic loading
===

Any ideas?

ps: I'm posting this to zope list because I'm sure there is more
people with this problem.


tia

Hugo


On Feb 20, 2008 10:35 AM, Chetan Kumar <[EMAIL PROTECTED]> wrote:
> Hello
> I understand.
> If I could take the risk of "telling-the-obvious" what you need to do
> is to recompile mysql so that mysqlclient_r libraries are also
> created.
> --enable-thread-safe-client is to be used while configuring the mysql
> installation.
> If that is done already, the LD_LIBRARY_PATH (or equivalent in your
> case) if to set appropriately so that lmysqlclient_r is available for
> linking.
> Good luck
> Chetan
>



-- 
Hugo Ramos - [EMAIL PROTECTED]
IT Project Manager

~~ @ ~~
http://www.orkut.com/Profile.aspx?uid=10082105466310142690
http://otuggapoesia.blogspot.com/
http://otugga.blogspot.com/
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL-python-1.2.2 breaks compiling on Mac OS X 10.5 (Andy Dustman?)

2008-02-20 Thread Hugo Ramos
Hey Kumar,

I like to think that the amount of time I could make anyone here spend
looking for something is VERY well spent.
That link you sent me is just 1 of the about 50 I searched on google
before posting the problem. :-)

I can tell you now that cp, mv and ln are not the solution.
I can also tell you that there's someone posting this and the patch to
MySQL-python sourceforge site as a bug in the setup_posix.py file
(which didn't solve my problem)

Finally I can also tell you that after compiling MySQL 5.0.51a from
source my /usr/local/mysql/lib and /usr/local/mysql/lib/mysql look
like this:

$ dir /usr/local/mysql/lib/
total 0
drwxr-xr-x   3 root  wheel  102 Feb 20 01:55 .
drwxr-xr-x  11 root  wheel  374 Feb 20 01:56 ..
drwxr-xr-x  14 root  wheel  476 Feb 20 01:55 mysql

$ dir /usr/local/mysql/lib/mysql/
total 3616
drwxr-xr-x  14 root  wheel 476 Feb 20 01:55 .
drwxr-xr-x   3 root  wheel 102 Feb 20 01:55 ..
-rw-r--r--   1 root  wheel   12168 Feb 20 01:55 libdbug.a
-rw-r--r--   1 root  wheel   40048 Feb 20 01:55 libheap.a
-rw-r--r--   1 root  wheel  351896 Feb 20 01:55 libmyisam.a
-rw-r--r--   1 root  wheel   21128 Feb 20 01:55 libmyisammrg.a
-rwxr-xr-x   1 root  wheel  375120 Feb 20 01:55 libmysqlclient.15.0.0.dylib
lrwxr-xr-x   1 root  wheel  27 Feb 20 01:55
libmysqlclient.15.dylib -> libmysqlclient.15.0.0.dylib
-rw-r--r--   1 root  wheel  492440 Feb 20 01:55 libmysqlclient.a
lrwxr-xr-x   1 root  wheel  27 Feb 20 01:55 libmysqlclient.dylib
-> libmysqlclient.15.0.0.dylib
-rwxr-xr-x   1 root  wheel 877 Feb 20 01:55 libmysqlclient.la
-rw-r--r--   1 root  wheel  262088 Feb 20 01:55 libmystrings.a
-rw-r--r--   1 root  wheel  262940 Feb 20 01:55 libmysys.a
-rw-r--r--   1 root  wheel5848 Feb 20 01:55 libvio.a

I run out of ideas now... after 3 days searching and testing... HELP
would be much appreciated.

Thanks guys


On Feb 20, 2008 3:08 AM, Chetan Kumar <[EMAIL PROTECTED]> wrote:
> Discussion and solution here
> http://forums.mysql.com/read.php?50,175059,180049
> Cheers!!!
> Chetan
>



-- 
Hugo Ramos - [EMAIL PROTECTED]
IT Project Manager
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySql connector error

2007-08-27 Thread Kevin
Your right, the older mysql da I was using gave 'Shouldn't Load State 
When Connection is Closed'.
It turns out that my DA is implemented correctly, but the database 
cursor is being persisted in another object(past transaction commit) as 
you noted.  So, with some readjusting, the error seems resolvable.


Thanks for the explanation!

-Kevin

Pelletier Vincent wrote:

Le Samedi 25 Août 2007 17:07, Kevin a écrit :
  

Intermittently, I recieve an error *Shouldn't load state for 0xf5f137
when the connection is closed
*



This means there is somewhere a reference to a persistent object which keeps 
it past transaction commit, which is a bad behaviour.


  

I implemented this object because the standard mysql database adapter
would fail if the connection was idle for some time with a similar kind
of error.



I *think* the error you previously got was not the same, but a "conection 
closed" from regular ZMySQLDA. It is because only the query is protected 
against such error (it causes a reconnection & query retry), but not the 
BEGIN query, which is of course issued first and causes the error to go up 
uncatched. I have a ZMySQLDA version which fixes this problem (an another 
tricky one), and it should get merged into upstream version in near future.

You can grab it on:

http://svn.erp5.org/erp5/trunk/products/ZMySQLDA/

Just one remark: a bug has been found in this version which causes problems if 
multiple connections with the same id exist in different places, due to a 
pooling mechanism used to fix the tricky bug. It will work just fine if you 
use site-scope unique ids - as it works for me - but you will get troubles if 
that's not the case.


  


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySql connector error

2007-08-27 Thread Pelletier Vincent
Le Samedi 25 Août 2007 17:07, Kevin a écrit :
> Intermittently, I recieve an error *Shouldn't load state for 0xf5f137
> when the connection is closed
> *

This means there is somewhere a reference to a persistent object which keeps 
it past transaction commit, which is a bad behaviour.

> I implemented this object because the standard mysql database adapter
> would fail if the connection was idle for some time with a similar kind
> of error.

I *think* the error you previously got was not the same, but a "conection 
closed" from regular ZMySQLDA. It is because only the query is protected 
against such error (it causes a reconnection & query retry), but not the 
BEGIN query, which is of course issued first and causes the error to go up 
uncatched. I have a ZMySQLDA version which fixes this problem (an another 
tricky one), and it should get merged into upstream version in near future.
You can grab it on:

http://svn.erp5.org/erp5/trunk/products/ZMySQLDA/

Just one remark: a bug has been found in this version which causes problems if 
multiple connections with the same id exist in different places, due to a 
pooling mechanism used to fix the tricky bug. It will work just fine if you 
use site-scope unique ids - as it works for me - but you will get troubles if 
that's not the case.

-- 
Vincent Pelletier
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Mysql Lock Unlock with zsql

2007-05-04 Thread Andreas Jung



--On 4. Mai 2007 17:34:23 +0200 [EMAIL PROTECTED] wrote:




Hi,

I must use mysql lock/unlock  with zsql. I haven't found anything about
it.  There is any solutions? I must lock a table but i don't know how do
it :(


Since LOCK is a SQL statement you can *of course* integrate with ZSQL 
method which basically send the configured SQL statements straight down to 
the database server...where is the problem`?


-aj

pgpkMeOLY7PFs.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] mysql socket problem, MOSX 10.4.7

2006-08-09 Thread Dieter Maurer
baiewola wrote at 2006-8-9 05:16 -0700:
> ...
>We can connect with PHP apps, Filemaker Pro, and MySQL client. However,
>all Z MySQL database connections are broken. Here is the error:
>OperationalError: (2002, "Can't connect to local MySQL server through
>socket '/tmp/mysql.sock' (2)")
>
>After googling and reading this article
>http://www.devshed.com/c/a/MySQL/Troubleshooting-Problems-with-MySQL-Programs/1/
>I think the problem is that the socket file is supposed to be at
>/tmp/mysql.sock but it's not there. How does it get there?

Usually, the server creates it on startup (when it is ready to
accept connections there).



-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL queries in Python

2006-08-01 Thread Paul Winkler
On Tue, Aug 01, 2006 at 02:50:19PM -0400, Muk Yan wrote:
> Dear Coveted Braintrust,
> 
> I was wondering if anyone had any experience with MySQL queries in Python in
> Zope:

People have already answered your main question, but:

> SELECT name
> FROM person
> WHERE ID = 

Never ever pass raw user input to a sql query!  If you're not familiar
with the phrase "sql injection"...  google it :)

The zope book relational databases chapter explains how to use
 which is one way to avoid the danger.  

-- 

Paul Winkler
http://www.slinkp.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL queries in Python

2006-08-01 Thread Dennis Allison

Usually you install the database adaptor ZMySQLDB and make queries through 
a ZSQL Method object.

On Tue, 1 Aug 2006, Muk Yan wrote:

> Dear Coveted Braintrust,
> 
> I was wondering if anyone had any experience with MySQL queries in Python in
> Zope:
> 
> import MySQLdb
> import string
> 
> request = container.REQUEST
> session = request.SESSION
> 
> result = (context.aq_parent).selects.select_from_table()
> 
> print result
> return printed
> 
> WHERE select.select_from_table() IS:
> 
> SELECT name
> FROM person
> WHERE ID = 
> 
> I know the MySQL query works, but I get garbage results from the python
> script ().  All I
> want is to contain the results of the SQL query in a list or container.
> 
> Thanks and take care,
> Muk Yan
> 

-- 

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL queries in Python

2006-08-01 Thread John Barham

import MySQLdb


This is probably redundant.


import string

request = container.REQUEST
session = request.SESSION

 result = (context.aq_parent).selects.select_from_table()

print result


Assuming you want the person's name printed, change this line to:

print result[0].name

Think of the result from a ZSQL query as a list/iterator over the
resulting rows.  In your case I'm assuming there is only one person
row w/ the given id, so there is only one row in the result, but you
still have to explicitly de-reference it w/ its index.

HTH,

 John
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL queries in Python

2006-08-01 Thread Andreas Jung



--On 1. August 2006 14:50:19 -0400 Muk Yan <[EMAIL PROTECTED]> wrote:


I know the MySQL query works, but I get garbage results from the python
script ().  All I
want is to contain the results of the SQL query in a list or container.



Zope Book 2.7 edition -> RDBMS chapter. The result object is an iterator 
will return a row of the resultset for each iteration.


-aj

pgpVcDD2jTQav.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL queries in Python

2006-08-01 Thread Jonathan



Have a look at this:
 
http://www.zope.org/Members/spinwing/ZSQL_Results
 
 
 
Jonathan

  - Original Message - 
  From: 
  Muk Yan 
  To: zope@zope.org 
  Sent: Tuesday, August 01, 2006 2:50 
  PM
  Subject: [Zope] MySQL queries in 
  Python
  Dear Coveted Braintrust,I was wondering if anyone had 
  any experience with MySQL queries in Python in Zope:import 
  MySQLdbimport stringrequest = container.REQUESTsession = 
  request.SESSIONresult = 
  (context.aq_parent).selects.select_from_table()print resultreturn 
  printedWHERE select.select_from_table() IS:SELECT nameFROM 
  personWHERE ID = I know the MySQL query works, but I get garbage 
  results from the python script ().  All I want is to contain the results of the SQL query 
  in a list or container. Thanks and take care,Muk Yan
  
  

  ___Zope maillist  
  -  
  Zope@zope.orghttp://mail.zope.org/mailman/listinfo/zope**   
  No cross posts or HTML encoding!  **(Related lists - 
   http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev 
  )
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySql 5.0, ZMySQLDA and stored procedures

2006-01-17 Thread Dieter Maurer
Cameron Beattie wrote at 2006-1-17 17:37 +1300:
>I was getting the following error when attempting to call a stored procedure 
>via a Z SQL Method:
>_mysql_exceptions.OperationalError: (1312, etc

You consult your MySQL documentation to find out what the error
code "1312" means...

-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySql 5.0, ZMySQLDA and stored procedures

2006-01-17 Thread Greg Fischer
Yeah, I put up a patch on the MySQLDb Sourceforge page a long time ago for that.  Doing almost the same thing. Only I made it so you specify the client flag in the Zope connection object.  Doesnt do any good for windows though, they still have a problem with the mysql lib. (I think I posted a bug on that too)
GregOn 1/16/06, Cameron Beattie <[EMAIL PROTECTED]> wrote:
I was getting the following error when attempting to call a stored procedurevia a Z SQL Method:_mysql_exceptions.OperationalError: (1312, etcSo I made the following change to/usr/lib/zope/lib/python/Products/ZMySQLDA/db.py:
def _parse_connection_string(self, connection):kwargs = {'conv': self.conv, 'client_flag': 65536 #inserted by CSB }I then restarted Zope. I can now successfully call stored procedures. There
may be a better way to do it. Feel free to advise if so.Apologies if this information has already been posted.Cameron___Zope maillist  -  
Zope@zope.orghttp://mail.zope.org/mailman/listinfo/zope**   No cross posts or HTML encoding!  **(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )-- 
Greg Fischer1st Byte Solutionshttp://www.1stbyte.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySql problems

2005-12-01 Thread Tino Wildenhain
Am Donnerstag, den 01.12.2005, 15:45 -0800 schrieb Dennis Allison:
> I have not yet completed differential diagnosis, but I was hoping someone 
> had encountered a similar problem and could pass along a fix/workaround.
> 
> The following program fails to do the writes -- 
> 
> import MySQLdb
> initdb='test'
> dbuser = 'root'
> dbpass = 'XX'
> host = 'localhost'
> connection = MySQLdb.connect( db=initdb,  user=dbuser, passwd=dbpass, 
> host=host )
> cursor = connection.cursor()
> qd = "delete from test.data"
> cursor.execute(qd)
> qi = "insert into test.data values('ardvark', 'homework') "
> print qi
> cursor.execute( qi)
> q2 = "select * from test.data"
> cursor.execute( q2)
> res = cursor.fetchall()
> print res

I see no connection.commit() there.
Zope always commits (if all successfull)
when a request is done.

> when run with Mysql-Python-1.2.1c under Python 2.4.2, but works just
> find with Mysql-Python-1.1.1 under Python 2.3.5.

This mysql-python-1.1.1 might have something like autocommit
switched on. The readme or changes.txt of both versions
should tell you that.

> The tables are Innodb tables (that is, transactional).
(more or less ;)

> Running Zope with Python 2.4.2 and Mysql-Pyton 1.2.1c works just fine.
> 

Regards
Tino

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Mysql 5? Just curious.

2005-10-06 Thread Greg Fischer
I guess it's not a matter of should, but rather a preference.  I
am running it just fine on Linux.  Had to do some tweeks to the
ZMySQLDA, but it works great.  Stored Procedures and
everything.  I just havent seen hardly anyone testing it, so I
thought I would ask around and see if others are running it too.

GregOn 10/6/05, Tino Wildenhain <[EMAIL PROTECTED]> wrote:
Greg Fischer schrieb:> This is totally unimportant, but I was just curious to know if anyone is> running Mysql 5 on Zope right now.why should one? :)-- 
Greg Fischer1st Byte Solutionshttp://www.1stbyte.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Mysql 5? Just curious.

2005-10-06 Thread Tino Wildenhain

Greg Fischer schrieb:
This is totally unimportant, but I was just curious to know if anyone is 
running Mysql 5 on Zope right now.


why should one? :)
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Mysql 5? Just curious.

2005-10-06 Thread Chris Withers

Richard Smith wrote:
A very quick test shows the basics work just fine (adding a record to a 
table and displaying the whole table).  Just watch authentication - 
they've changed the password algorithms again as in the 3/4 upgrade.  
The work around is in the manual.


rats, probably only an issue if someone's using MySQL encrypted 
passwords and SUF, and will require a patch to Zope. *sigh*


Chris

--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Mysql 5? Just curious.

2005-10-05 Thread Chris Withers

Greg Fischer wrote:

This is totally unimportant, but I was just curious to know if anyone is
running Mysql 5 on Zope right now.


That would be some achievement! ISn't MySQL written in C++ or something?

Seriously though, Andy Dustman is your man, maybe try compiling mySQLdb 
and seeing if it'll connect to MySQL 5?


cheers,

Chris

--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] mysql-python build error

2005-09-13 Thread Sophia Grimm
It turned out there were two different problems at
work here.

First, I had to hard code the paths of my include_dirs
and include_lib.

Second, I didn't realize my bash shell wasn't taking
the export command. I had to edit my bash profile to
set the mysqlclient environment variable (which is the
path of the mysql installation).

Thanks to everyone who responded!

SG

--- Sophia Grimm <[EMAIL PROTECTED]> wrote:

> I installed Plone 2.1 from the binary installer at
> plone.org and MySQL 4.1 from the binary at
> mysql.com.
> When attempting to build MySQL-python-1.2.0 on MOSX
> 10.4.2 client, I get this error:
> 
> sh: line 1: mysql_config: command not found
> sh: line 1: mysql_config: command not found
> running build
> running build_py
> running build_ext
> building '_mysql' extension
> gcc -bundle -undefined dynamic_lookup
> build/temp.darwin-8.2.0-Power_Macintosh-2.3/_mysql.o
> -L/usr/local/mysql/include -lz -lmysqld -o
> build/lib.darwin-8.2.0-Power_Macintosh-2.3/_mysql.so
> /usr/bin/ld: can't locate file for: -lmysqld
> collect2: ld returned 1 exit status
> error: command 'gcc' failed with exit status 1
> 
> Obviously, it's looking for -lmysqld. I don't know
> where to change setup.py (or what to change it to)
> so
> this will work. Any tips are appreciated!!
> 
> SG
> 
> 
>   
> __ 
> Yahoo! Mail - PC Magazine Editors' Choice 2005 
> http://mail.yahoo.com
> ___
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
> 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL timestamp issue

2005-06-06 Thread Hugo Ramos
Yellow Andy,

In fact what you've said works!
That line was missing on db.py and after I inserted it there
everything works the right way.

I guess this thread is now over. Thanks!!!


Cheers
Hugo



On 6/3/05, Andy Dustman <[EMAIL PROTECTED]> wrote:
> On 6/3/05, Hugo Ramos <[EMAIL PROTECTED]> wrote:
> > Yellow,
> >
> > I wrote the wrong version.
> > I'm using MySQL 4.0.24 + Zope 276 + mysql-python 1.0.0 + ZMySQLDA 2.0.9b3
> 
> Take a look at ZMySQLDA/db.py:
> 
> http://cvs.sourceforge.net/viewcvs.py/mysql-python/ZMySQLDA/lib/python/Products/ZMySQLDA/db.py?rev=1.21&view=auto
> 
> You may need to add a line like this to the DB class:
> 
> conv[FIELD_TYPE.TIMESTAMP] = _mysql_timestamp_converter
> 
> Not sure why this is missing.
> 
> --
> Computer interfaces should never be made of meat.
> http://www.terrybisson.com/meat.html
> 


-- 
Hugo Ramos - [EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL timestamp issue

2005-06-03 Thread Andy Dustman
On 6/3/05, Hugo Ramos <[EMAIL PROTECTED]> wrote:
> Yellow,
> 
> I wrote the wrong version.
> I'm using MySQL 4.0.24 + Zope 276 + mysql-python 1.0.0 + ZMySQLDA 2.0.9b3

Take a look at ZMySQLDA/db.py:

http://cvs.sourceforge.net/viewcvs.py/mysql-python/ZMySQLDA/lib/python/Products/ZMySQLDA/db.py?rev=1.21&view=auto

You may need to add a line like this to the DB class:

conv[FIELD_TYPE.TIMESTAMP] = _mysql_timestamp_converter

Not sure why this is missing.

-- 
Computer interfaces should never be made of meat.
http://www.terrybisson.com/meat.html
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL timestamp issue

2005-06-03 Thread Hugo Ramos
Yellow,

I wrote the wrong version.
I'm using MySQL 4.0.24 + Zope 276 + mysql-python 1.0.0 + ZMySQLDA 2.0.9b3

This is the DTML code generating the error:


docdataemissao is a timestamp field in a table like:
200406011023

The traceback:
Error Type: ValueError
Error Value: unsupported format character 'Y' (0x59) at index 1

[...]
Module DocumentTemplate.DT_String, line 474, in __call__ 
Module DocumentTemplate.DT_In, line 703, in renderwob 
Module DocumentTemplate.DT_Var, line 280, in render
__traceback_info__: ('docdataemissao', , {'': 'docdataemissao', 'fmt':
'%Y-%m-%d'})

Any ideas???


Cheers
Hugo



On 6/3/05, Andy Dustman <[EMAIL PROTECTED]> wrote:
> On 6/3/05, Hugo Ramos <[EMAIL PROTECTED]> wrote:
> > I already know what exactly makes Zope hang!
> > The problem is located at times.py that was installed by MySQL-Python
> > 1.2.0 (MySQL-python.exe-1.2.0.win32-py2.4.zip)
> 
> This is a package for Python-2.4. Are you using Python-2.4 with
> Zope-2.7? If you are, the line of people prepared to yell at you is
> long and distinquished.
> 
> What version of ZMySQLDA are you using? Only 2.0.9b3 will work
> properly with MySQLdb-1.2.0.
> --
> Computer interfaces should never be made of meat.
> http://www.terrybisson.com/meat.html
> 


-- 
Hugo Ramos - [EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL timestamp issue

2005-06-03 Thread Andy Dustman
On 6/3/05, Hugo Ramos <[EMAIL PROTECTED]> wrote:
> I already know what exactly makes Zope hang!
> The problem is located at times.py that was installed by MySQL-Python
> 1.2.0 (MySQL-python.exe-1.2.0.win32-py2.4.zip)

This is a package for Python-2.4. Are you using Python-2.4 with
Zope-2.7? If you are, the line of people prepared to yell at you is
long and distinquished.

What version of ZMySQLDA are you using? Only 2.0.9b3 will work
properly with MySQLdb-1.2.0.
-- 
Computer interfaces should never be made of meat.
http://www.terrybisson.com/meat.html
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL timestamp issue

2005-06-03 Thread Hugo Ramos
I already know what exactly makes Zope hang!
The problem is located at times.py that was installed by MySQL-Python
1.2.0 (MySQL-python.exe-1.2.0.win32-py2.4.zip)

==OLD==
def mysql_timestamp_converter(s):
"""Convert a MySQL TIMESTAMP to a Timestamp object."""
s = s + "0"*(14-len(s)) # padding
parts = map(int, filter(None, (s[:4],s[4:6],s[6:8],
   s[8:10],s[10:12],s[12:14])))
try: return apply(Timestamp, tuple(parts))
except: return None
==OLD==

HACKED
import DateTime

def mysql_timestamp_converter(s):
"""Convert a MySQL TIMESTAMP to a Timestamp object."""
s = s + "0"*(14-len(s)) # padding
parts = map(int, filter(None, (s[:4],s[4:6],s[6:8],
   s[8:10],s[10:12],s[12:14])))
try: return apply(DateTime.DateTime, tuple(parts))
except: return None
HACKED

Oren Goldschmidt helped me here and we just made a very nasty hack...
As you can see we imported DateTime and replaced the Timestamp inside
the try statement.

This makes Zope behave!!! But it's a nasty hack that could break other
stuff around there.

Comments???


Cheers
Hugo



On 6/3/05, Chris Withers <[EMAIL PROTECTED]> wrote:
> Hugo Ramos wrote:
> > Could anyone explain me why this works in Zope 2.7.0 final and doesn't
> > work in Zope 2.7.6 final and/or 2.8.0b1 ??
> 
> If Zope is really hanging, look at DeadlockDebugger and find out where
> it's hanging...
> 
> Chris
> 
> --
> Simplistix - Content Management, Zope & Python Consulting
> - http://www.simplistix.co.uk
> 
> 


-- 
Hugo Ramos - [EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MySQL timestamp issue

2005-06-03 Thread Chris Withers

Hugo Ramos wrote:

Could anyone explain me why this works in Zope 2.7.0 final and doesn't
work in Zope 2.7.6 final and/or 2.8.0b1 ??


If Zope is really hanging, look at DeadlockDebugger and find out where 
it's hanging...


Chris

--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] MYSQL Problem

2001-01-29 Thread Andy Dustman

On Sun, 28 Jan 2001, Jens Grewen wrote:

> I installed 
> 
> mySQL-3.23.32
> mySQLdb 0.3.1
> ZmySQLDA 2.0.4
> 
> When I change to mediumint (database field description) I get the
> expected 233.
> 
> How can I fix this.

You just did. :) If a mediumint is big enough for you, use that. As Ron
points out, INTEGER (particularly UNSIGNED) can overflow in Python, so
they need to be returned as Python long integers. Python adds the L when
doing str(), but Python 2.0+ does not do this (only on repr()).

-- 
Andy Dustman PGP: 0xC72F3F1D
@   .net http://dustman.net/andy
"Normally with carbonara you use eggs, but I used lobster brains instead."
-- Masahiko Kobe (Iron Chef Italian): 30-year-old Giant Lobster Battle


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] MYSQL Problem

2001-01-27 Thread Ron Bickers

The trailing L identifies a long int in Python.  As of ZMySQLDA 2.0.4, MySQL
integers use Python longs because an unsigned MySQL integer could overflow a
Python int.  So, it's a bug fix.

A couple solutions (found at http://dustman.net/andy/python/ZMySQLDA/2.0.4)
are to use  or something similar to strip the L, or
use Python 2.x, which would not display the L in this case.  You could also
modify MySQLDA to use a Python int if you know you're not going to have
integers that will overflow.

Note that Python 2 is not officially supported by Digital Creations, though
it does happen to work with Zope 2.3.0.
___

Ron Bickers
Logic Etc, Inc.
[EMAIL PROTECTED]


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jens
Grewen
Sent: Saturday, January 27, 2001 11:36 PM
To: Zope Maillist
Subject: [Zope] MYSQL Problem

>From the following SQL statment I get the result  233L and not 233 as
expected

select count(PID)
from product

When I run this SQL Statment from another program I get the expected value
233.


In my installation there are a lot of Z SQL Methods that should return an
int value and when I use field description int in the database I always get
this 'L' behind the expected result. A lot of things don´t work because of
this.

When I change to mediumint (database field description) I get the expected
233.

How can I fix this.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] MySQL

2001-01-26 Thread Andy Dustman

On Fri, 26 Jan 2001, Piotr Kozbial wrote:

> I have upgraded to MySQL 3.23.28 and both ZMySQLDA and ZMySQLTDA were
> broken.Thus I have installed latest
> ZMySQLDA-2.0.4 and MySQLdb 0.3.1.

MySQL-3.23.32 would be a good idea. It has at least one security fix, and
a lot of bug fixes. 
 
> Ufter upgrade it does not work.
>   File /opt/www/zope/lib/python/DocumentTemplate/DT_In.py, line 711, in
> renderwob
> (Object: single_id_hasla2)
>   KeyError: (see above)

I have no idea for that one.
 
> I am unable to use TIMESTAMP from database
> ie.:
>   File /opt/www/zope/lib/python/Products/ZMySQLDA/db.py, line 104, in
> _mysql_timestamp_converter
> ValueError: (see above)

Can you find out what the value is that it doesn't like?
 
> What is wrong. Is is MySQL or ZOPE or ZMySQLDA problem?

Possibly ZMySQLDA. I would need to see specifically what the error message
is that comes with the ValueError exception. 

-- 
Andy Dustman PGP: 0xC72F3F1D
@   .net http://dustman.net/andy
"Normally with carbonara you use eggs, but I used lobster brains instead."
-- Masahiko Kobe (Iron Chef Italian): 30-year-old Giant Lobster Battle



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] MySQL connection string.

2001-01-21 Thread Joachim Werner

Indra Gunawan wrote:

> Hello,
> could anyone tell me how to make connection string to MySQL in Linux?
> I use Zope 2.3 and I've tried the 
> 
> database@[host] username password

This should work. Your problem is probably somewhere else. Are you sure 
that the database adapter, database etc. are all set up correctly?

Joachim.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] mysql connection string

2001-01-15 Thread Oleg Broytmann

On Mon, 15 Jan 2001, Olaf Zanger wrote:
> right now my setup uses a connection string "db root" which doesn't seam
> to give a lot of savety :-).
> at my provider i have a login, but sure no root access to the db.
> * how does the connection string look for user name "peter-hauser" and
> password "test3-.2"?

   [EMAIL PROTECTED] peter-hauser test3-.2 <--\
|
> * has the user to be set up in "linux" ?  |
|
   No, only in mysql.   |
|
> * how is the setup made in "mysql"?   |
|
   GRANT select,insert,update,delete,create,alter,drop,index|
ON db.* TO [EMAIL PROTECTED] INDENTIFIED BY 'test3-.2';|
|
> * has zope to be run by user "peter-hauser"?  |
|
   No, you pass peter-hauser in the connection string >-/

Oleg.

 Oleg Broytmann http://www.zope.org/Members/phd/ [EMAIL PROTECTED]
   Programmers don't die, they just GOSUB without RETURN.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] MySQL

2001-01-11 Thread Petter Enholm


Hi,

I did not get mySQL running using the HOW-TO below. It seems to be outdated,
as there is not need for patching anymore. The following HOW-TO is newer;
http://www.zope.org/Members/MikeP/ZMySQLDA. I had mySQL up and running in no
time when following this HOW-TO.

If you are using mySQL on WIN32 use the following HOW-TO:
http://www.zope.org/Members/philh/mysql, and download all the files this
HOW-TO refers to, instead of compiling your own (if you don't know exactly
what you are doing).

I don't want to sound negative, but someone should really tidy up these
HOW-TOs for mySQL and remove the old ones. What caused me most trouble when
installing mySQL for the first time was to find the correct HOW-TO.

Q: Are there any person responsible for the HOW-TO's?

Suggestion: Now that there are many persons working with Zope, writing
HOW-TO's etc - would it be an idea to create categories for the different
HOW-TO's and that each category should have a maintainer, responsible for
removing old HOW-TO's or at least clearly state which version of the
products they are valid for? I could take responsibility for one category
... I think this could improve the quality of the available
documentation.

Best regards
Petter Enholm

Also:
- Original Message -
From: "Eric Walstad" <[EMAIL PROTECTED]>
To: "vishnu prasad" <>
Cc: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
Sent: Wednesday, January 10, 2001 12:32 AM
Subject: RE: [Zope] MySQL


> http://www.zope.org/Members/alanpog/zmysqlda_steps
> Should get you started...
> Eric.
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of vishnu
> prasad
> Sent: Tuesday, January 09, 2001 3:17 PM
> To: [EMAIL PROTECTED]
> Subject: [Zope] MySQL
>
>
> can anyone update me with list of activities that I need to follow for
> having MySQL installed and integrated with Zope?
>
> thanks in advance,
> vp
>
>
> ___
> Zope maillist  -  [EMAIL PROTECTED]
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] MySQL

2001-01-11 Thread Eric Walstad

http://www.zope.org/Members/alanpog/zmysqlda_steps
Should get you started...
Eric.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of vishnu
prasad
Sent: Tuesday, January 09, 2001 3:17 PM
To: [EMAIL PROTECTED]
Subject: [Zope] MySQL


can anyone update me with list of activities that I need to follow for
having MySQL installed and integrated with Zope?

thanks in advance,
vp


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] MySQL connection woes

2001-01-09 Thread paul_s_johnson




One other bizarre symptom: when I test the database connection with a
INSERT query it works and inserts data into the designated MySQL table in
the query, although there is no indication that it is working in Zope. I
changed the user table for the MySQL user cited in the connection string so
that all privileges are on and still no luck.

P. Johnson

>>For a quick test, run the mysql client from the command line.
>>
>>Let's say your connection string was:
>>  foodb paul passwd
>>
>>Start mysql like this:
>>$ mysql -u paul -p foodb
>>
>>And when prompted for the password, enter passwd.
>>
>>This will ensure mysql is setup correctly.  Make sure you do this from
>>the same machine that is running Zope, as MySql can be configured for
>>different access from different machines.
>>
>>If you want to play with "null" passwords and such, look at the
>>mysql.user and mysql.db tables.  Remember to run "mysqladmin
>>flush-privileges" after making changes to the user and db tables.
>
>This last part I did not know, thanks!
>
>Ok, I am getting closer. I finally found a connection string that Zope
>accepts, but now when I test the connection with a query like "SHOW
>TABLES;" or a SELECT query it I get the message:
>
> "There was no data matching this Z MySQL Database Connection
>(connected) query."
>
>- even though I know these tables exist. The connection says that it is
>open and it will only accept connection strings of databases that really
>exist in MySQL.

>INFO:
>MySQL user name: root
>hostname: www.myhost.com
>password: none
>
>Zope Connection string: [EMAIL PROTECTED] root
>
>In the grant tables there is the following entries:
>In user: [EMAIL PROTECTED] with no privileges
>In db: [EMAIL PROTECTED] with all privileges for mydatabase.* except for
>Grant_priv
>
>One other parameter that may have a bearing: the box's name is
>station99.ispname.net even though it hosts www.myhost.com (or is it the
>other way around?).
>
>Any suggestions why the connection is not working properly?






___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] MySQL connection woes

2001-01-09 Thread paul_s_johnson

   
   
   
   
"Randall F.  To: <[EMAIL PROTECTED]>  
   
Kern"cc:   
   
   
   
   
   
01/09/01   
   
12:08 PM   
   
   
   
   
   







>For a quick test, run the mysql client from the command line.
>
>Let's say your connection string was:
>  foodb paul passwd
>
>Start mysql like this:
>$ mysql -u paul -p foodb
>
>And when prompted for the password, enter passwd.
>
>This will ensure mysql is setup correctly.  Make sure you do this from
>the same machine that is running Zope, as MySql can be configured for
>different access from different machines.
>
>If you want to play with "null" passwords and such, look at the
>mysql.user and mysql.db tables.  Remember to run "mysqladmin
>flush-privileges" after making changes to the user and db tables.

This last part I did not know, thanks!

Ok, I am getting closer. I finally found a connection string that Zope
accepts, but now when I test the connection with a query like "SHOW
TABLES;" or a SELECT query it I get the message:

 "There was no data matching this Z MySQL Database Connection
(connected) query."

- even though I know these tables exist. The connection says that it is
open and it will only accept connection strings of databases that really
exist in MySQL.

INFO:
MySQL user name: root
hostname: www.myhost.com
password: none

Zope Connection string: [EMAIL PROTECTED] root

In the grant tables there is the following entries:
In user: [EMAIL PROTECTED] with no privileges
In db: [EMAIL PROTECTED] with all privileges for mydatabase.* except for
Grant_priv

One other parameter that may have a bearing: the box's name is
station99.ispname.net even though it hosts www.myhost.com (or is it the
other way around?).

Any suggestions why the connection is not working properly?






___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] MySQL connection woes

2001-01-09 Thread Luciano Ramalho

I don't know how to create a null login in MySQL, but I know a better
solution. The last time I had a problem like yours I created a user in
MySQL and used it connect Zope.

In mysql you type:

GRANT ALL ON my_database.* TO my_user IDENTIFIED BY my_passwd

(The .* part is a wildcard meaning all tables in this database.)

Then you can connect Zope using a connection string like this:

my_user@localhost my_passwd

Good luck,

Luciano

PS. 


[EMAIL PROTECTED] wrote:
> 
> After following several howtos, tracking numerous threads from this list,
> and spending several days losing my mind, I sense that I am finally getting
> closer to having Zope and MySQL talking to each other.
> 
> SETUP:
> I am running on Linux with Redhat with MySQL 3.22.32 and ZMySQLDA with
> ZMySQL-python.  The later two are installed such that ZMySQLDA is NOT
> broken. I installed using the RPMs supplied by Ron Bickers available on his
> FTP site (thanks, Ron) and followed additional instructions supplied on
> earlier threads.
> 
> PROBLEM:
> My problem now is I can't find a connection string that works. I understand
> the connection syntax and tried every possibility. My suspicion is that I
> am having a permissions problem with MySQL. I found this former list email:
> 
> >> My suggestion would be to set up mysql to accept a null login (no
> >> username, no password), create a database in there called "test" and
> >> connect with the connection string "test@localhost"
> 
> >thank u, this was the point to my problem. I have tried a nologin mysql
> and it
> >worked with database@myhost !!! :)
> >so i know i have a grant table problem in mysql (no big deal - i hope :) )
> 
> QUESTION:
> Being a relative newbie to this whole thing (Linux, Zope, MySQL, etc.), how
> do I create a null login in MySQL with blanket privleges? Could it still be
> a faulty ZMySQLDA setup? How do I troubleshoot that possibility?
> 
> Thanks,
> 
> P. Johnson
> 
> ___
> Zope maillist  -  [EMAIL PROTECTED]
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] mySQL DA on Win32

2000-12-14 Thread Lloyd Kvam

I came across links that recommended recompiling both MySQL and the MySQL DA.  I
did so without too much difficuly.  The batch compile scripts did not work, but
compiling through the MicroSoft IDE did work.  The source code I pulled down
required the Microsoft compiler, not gcc++.

I still have the download files.  I could also send you the results of my
compilations.  I do not remember the URL's I used to get these files, but it was
probably through the mysql web site.

Lee Reilly CS1997 wrote:

> Hi,
>
> Zope is currently being installed on the Unix machines at my uni but it
> won't be available for a while. However, I have set up a mySQL database
> in the Dept. and installed Zope on a Dept. machine (Windows 95). I can
> only access the database from uni so I must have a database adpater
> setup on this machine.
>
> I have seen the mySQL DA on Zope.org but I understand that it "does not
> support win32 platforms at this time". I need database access ASAP so
> can anyone offer any advice?
>
> Thanks very much,
>
> Lee
>
> ___
> Zope maillist  -  [EMAIL PROTECTED]
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )

--
Lloyd Kvam
Venix Corp.
1 Court Street, Suite 378
Lebanon, NH 03766-1358

voice: 603-443-6155
fax: 801-459-9582



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] mySQL DA on Win32

2000-12-14 Thread sean . upton

Couldn't one just use MyODBC and the ODBC DA?  What disadvantages (besides
latency from yet another API to go through) are there to this approach?

Sean

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] mySQL DA on Win32

2000-12-14 Thread Jim Washington

Hi, Lee

I got zope and mysql working together last night on win2k.  I used the
instructions in

http://www.zope.org/Members/philh/mysql

(Thanks, Phil Harris!)

I did have to use the custom dll and pyd mentioned there.

http://www.google.com/search?q=mysql+zope+win32 might have more clues if
this does not meet your needs.  

To answer your next question, 
the connection string is like 'db@host username password'

hth,

-- Jim Washington

Lee Reilly CS1997 wrote:
> 
> Hi,
> 
> Zope is currently being installed on the Unix machines at my uni but it
> won't be available for a while. However, I have set up a mySQL database
> in the Dept. and installed Zope on a Dept. machine (Windows 95). I can
> only access the database from uni so I must have a database adpater
> setup on this machine.
> 
> I have seen the mySQL DA on Zope.org but I understand that it "does not
> support win32 platforms at this time". I need database access ASAP so
> can anyone offer any advice?
> 
> Thanks very much,
> 
> Lee

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] mySQL DA on Win32

2000-12-14 Thread Petter Enholm

> From: "Lee Reilly CS1997" <[EMAIL PROTECTED]>
>
> I have seen the mySQL DA on Zope.org but I understand that it "does not
> support win32 platforms at this time". I need database access ASAP so
> can anyone offer any advice?

There is a HOW-TO for this:  How-To: ZMySQLDA on Win32

Search for it on www.zope.org. I run Zope and mySQL (3.23.28-gamma) on
Win95. Advice; download the files as specified in the how-to. I tried to use
the .dll file that we're installed with mySQL  - crashed Python/Zope. Also,
remember to store Python files in correct Python directory if you have
installed more than one version / installation of Python.

Best regards
Petter Enholm
Snapper


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] mySQL DA on Win32

2000-12-14 Thread Phil Harris

Lee,

Have you read the MySQL on Win32 howto?

btw,  give my regards to Duncan. 

Phil
[EMAIL PROTECTED]

- Original Message - 
From: "Lee Reilly CS1997" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 14, 2000 2:46 PM
Subject: [Zope] mySQL DA on Win32


> Hi,
> 
> Zope is currently being installed on the Unix machines at my uni but it
> won't be available for a while. However, I have set up a mySQL database
> in the Dept. and installed Zope on a Dept. machine (Windows 95). I can
> only access the database from uni so I must have a database adpater
> setup on this machine.
> 
> I have seen the mySQL DA on Zope.org but I understand that it "does not
> support win32 platforms at this time". I need database access ASAP so
> can anyone offer any advice?
> 
> Thanks very much,
> 
> Lee
> 
> ___
> Zope maillist  -  [EMAIL PROTECTED]
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] mysql & zope

2000-11-30 Thread Dieter Maurer

Alexander DePauli writes:
 > ... using Zope management interface with custom objects ...
The form actions of the Zope management interface are not
built in. They are methods of the managed objects.

  This implies, if your objects override these management
  method, you get different behaviour.

I am not sure, whether ZClass'es will allow you to
override the methods. If not, you will need
special Python base classes that implement the basic
infrastructure for you ZClasses.


Dieter

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] MySQL

2000-11-30 Thread Eric Walstad

http://www.zope.org/Members/alanpog/zmysqlda_steps

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of K H
Subrahmanyan
Sent: Thursday, November 30, 2000 4:08 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: [Zope] MySQL


hi,
   I want to add MySQL to my ZOPE.

Please help me in installing it.

Please give the links, necessary information.

thanks
bye
subrahmayan.



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] mysql & zope

2000-11-30 Thread Steve Spicklemire


Hi  Ruediger,

You might consider ZPatterns. It allows you to develop
applications with ZODB, and then, later, 'easily' switch to
other forms of attribute storage for your objects.

-steve

> "Alexander" == Alexander DePauli <[EMAIL PROTECTED]> writes:

Alexander> Hi Zopistas!

Alexander> we are looking for a method to do a better integration
Alexander> of mysql 3.23.27 with zope 2.2.2. (we are using the Z
Alexander> MySQL database adapter Z MySQL DA 1.1.3.)

Alexander> We have to store data in a mysql database - we can´t
Alexander> use ZODB because we need the data accessible by other
Alexander> programs via ODBC.

Alexander> We habe implemented several ZClasses like "customer",
Alexander> "product" and "orders".  We store their instances
Alexander> (eg. each product, customer and so on) to the
Alexander> mysql-database.

Alexander> Our problem: we can´t use the standard ZOPE management
Alexander> interface to manage the objects, because the methods of
Alexander> this interface store content to the ZODB - and not to
Alexander> the mysql-database.

Alexander> Is there a way to extend the standard ZOPE management
Alexander> interface with additional mysql statements?  For
Alexander> example: we select an object in a zope folder, press
Alexander> the ZOPE Delete-Button, then this object is deleted on
Alexander> the mysql-database, not on the ZODB?

Alexander> For each zclass (customer, products, orders) we need
Alexander> these extra methods (Delete, Update, Insert ...), so
Alexander> our thought is that we would prefer to use the ZOPE
Alexander> management interface to do this instead of programming
Alexander> "extra methods" which obviously can't be used within
Alexander> the standard ZOPE management interface.

Alexander> Hope there is somebody out there with an similarly
Alexander> problem solved.

Alexander> best regards

Alexander> Ruediger ~
Alexander> http://www.herrenausstatter.de - Der
Alexander> Online-Herrenausstatter Kostenlose Serviceline: 0800
Alexander> -999 66 33 Versandkostenfreie Lieferung - 30 Tage
Alexander> Rückgaberecht ~
Alexander> Verwaltungsadresse: DePauli.com Aktiengesellschaft
Alexander> Stahlgruberring 3 - 81829 München Telefon: 089 / 530 75
Alexander> 170 - Telefax 089 / 514 50 666

Alexander> ___ Zope
Alexander> maillist - [EMAIL PROTECTED]
Alexander> http://lists.zope.org/mailman/listinfo/zope ** No cross
Alexander> posts or HTML encoding!  ** (Related lists -
Alexander> http://lists.zope.org/mailman/listinfo/zope-announce
Alexander> http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] MySQL

2000-11-30 Thread Chris Withers

K H Subrahmanyan wrote:
> 
> hi,
>I want to add MySQL to my ZOPE.
> 
> Please help me in installing it.
> 
> Please give the links, necessary information.

How about actually doing some work for yourself for a change rather than
expecting everyone else to do it for you?

Chris

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] MySQL Connection String

2000-11-17 Thread Eric Walstad

I use the following format:

users@frankenstein privileged_user ThePassWord
- or in general terms -
TableName[@HostNameOfMachineMySQLIsRunningOn] MySQLUserName ThePassWord

I guess the "@HostNameOfMachineMySQLIsRunningOn" part is optional, but I
needed to put it in there for my setup.
The "privileged_user" is one that you've done a MySQL GRANT for. I.e.
something like:
GRANT SELECT,INSERT,UPDATE ON DatabaseName.TableName TO MySQLUserName
IDENTIFIED BY 'ThePassWord';

FYI, I found this info in ALANPOG's HowTo:
http://www.zope.org/Members/alanpog/zmysqlda_steps

hth, Eric.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Aitor
Grajal Crespo
Sent: Friday, November 17, 2000 8:37 AM
To: [EMAIL PROTECTED]
Subject: [Zope] MySQL Connection String


  I have installed ZMySQLDA 1.1.4,
anybody knows the format of the database connection string???

I have put database user passw , and doesn't work

Thanks


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] MySQL Connection String

2000-11-17 Thread Tony McDonald

On 17/11/00 4:36 pm, "Aitor Grajal Crespo" <[EMAIL PROTECTED]>
wrote:

> I have installed ZMySQLDA 1.1.4,
> anybody knows the format of the database connection string???
> 
> I have put database user passw , and doesn't work
> 
> Thanks
> 
> 

database@host user passwd

'host' can be 'localhost' for database servers on the same machine as
Zope...
hth
Tone
--
Dr Tony McDonald,  Assistant Director, FMCC, http://www.fmcc.org.uk/
The Medical School, Newcastle University Tel: +44 191 222 5116
A Zope list for UK HE/FE  http://www.fmcc.org.uk/mailman/listinfo/zope


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] MySQL and Zope struggles

2000-10-18 Thread Baker, Dennis [sjmr]

What about one sql method:

select @noteid:=note_id from artist where 
 
update note set notes =
 where note_id = @noteid



-Original Message-
From: Richard Moon [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 16, 2000 2:48 AM
To: [EMAIL PROTECTED]
Subject: [Zope] MySQL and Zope struggles


I'm struggling to migrate an application from Zope/PostgreSQL to Zope MySQL 
(Why ? - because I've got a kind offer of free hosting if I use MySQL).

MySQL offers a limited set of features and is missing, among other things, 
the ability to use subqueries - so for example in PostgreSQL you can say

update note set notes =
 where note_id =
 (select note_id from artist where )

and in MySQL you can't.

If you were working in a traditional programming environment you could 
overcome this by splitting the above into two parts - a select to retrieve 
the value of note_id from the artist table followed by an update of the 
note table using the returned value of note-id.

For example

select note-id into note-id-var from artist where artist-id = 23;
update note set notes = 'asdasda' where note-id = note-id-var;

The problem is that in Zope I believe you can't use a returned value within 
an SQL Method,  so the above code would fail. The only way I can see to do 
the above is to have two separate SQL Methods, one for the select, 
returning the note-id-var and another for the update. This is very clumsy.

I was wondering if anyone could tell me if there was a better way.

Many thanks


Richard

Richard Moon
[EMAIL PROTECTED]



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] MySQL and Zope struggles

2000-10-18 Thread Richard Moon

Thanks Monty,

I did try the temporary table route - problem is that Zope keeps the 
connection open so the temporary table stays there. Of course you can 
explicitly drop the temporary table after you've used it. However if the 
update fails for any reason the temporary table will still exist so next 
time in the SQL method fails because its trying to create a temporary table 
that is already there. I know this shouldn't happen etc but I don't like 
code that has that kind of potential problem in it - it isn't 'fail-safe'.

I decided better to use a permanent table. The SQL method locks it, deletes 
everything in it then writes the data it needs to store. That way its fail 
safe and I would expect more efficient than creating and dropping tables.

However I hadn't appreciate the REPLACE command. That's a real hidden gem. 
I'm off to see if I can use it - thanks.

Richard

At 11:37 17/10/00, you wrote:
>You can do it with temporary tables.
>
>Like this-
>
>create temporary table foo (
>   note_id int,
>   notes varchar
>);
>insert into foo select Note.note_id, Note.notes from Note, Artist
>   where Note.note_id=Artist.note_id and Artist.artist_id=23;
>update foo set notes="asdlfna";
>replace into Note select note_id, notes from foo;
>
>This does assume that the note_id is unique.
>You may also need to explicitly drop foo, because it goes away when you
>disconnect, but of course  Zope holds connections open.
>
>!!! However -- now that I think of it... you can just do:
>replace into Note select note_id, "New Note" from Artist where artist_id=23;
>
>Of couse, this will change all notes for an artist, so it assumes the
>artist_id is unique as well. (Which I would assume it is from your model.)
>
>If you need more complex things, look into temporary tables, but the MySQL
>extension (like replace) do allow you to do fun things.
>
>Hope this helps,
>Monty
>
>Richard Moon wrote:
>
> > Nice idea. Trouble is the note table is used to hold notes for many
> > different reasons, so it looks like this -
> >
> >   ---   
> > | Artist| | Recording  |  | Label  |   etc.
> >   ---   
> > | artist_id | |recording_id|  |label_id|
> > | note_id   | |note_id |  |note_id |
> >   ---   
> >   |   ||  |   |
> >-
> > |
> > --
> >| Note |
> > --
> >| note_id  |
> >| notes|
> > --
> >
> > It looks as if there wasn't anything I was missing - I'm just going to have
> > to break the code up into separate SQL Methods.
> >
> > The example I gave was quite simple compared to some of the updates I have
> > to deal with.
> >
> > Thanks anyway.
> >
> > At 17:40 16/10/00, you wrote:
> > >Or you could renormalize your data to have:
> > >
> > >  - ---
> > >|  Artist |   |  Note |
> > >|-|---|---|
> > >|  id |   | id|
> > >  -| artist_id |
> > >   | note_str  |
> > >---
> > >
> > >you now have a list of notes by artist_id.
> > >You typically won't have a screen that doesn't have an Artist context
> > >to be adding a note to. (or to remove all notes from).
> > >Of course this means more work to migrate :-(
> > >And I don't know all possible scenarios for which you would
> > >need the structure you gave, but it is another way around this.
> > >It probably doesn't solve real complex scenarios either.
> > >
> > >JAT
> > >
> > >Dale
> >
> > Richard Moon
> > [EMAIL PROTECTED]
> >
> > ___
> > Zope maillist  -  [EMAIL PROTECTED]
> > http://lists.zope.org/mailman/listinfo/zope
> > **   No cross posts or HTML encoding!  **
> > (Related lists -
> >  http://lists.zope.org/mailman/listinfo/zope-announce
> >  http://lists.zope.org/mailman/listinfo/zope-dev )
>
>
>___
>Zope maillist  -  [EMAIL PROTECTED]
>http://lists.zope.org/mailman/listinfo/zope
>**   No cross posts or HTML encoding!  **
>(Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )


Richard Moon
[EMAIL PROTECTED]



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] MySQL and Zope struggles

2000-10-17 Thread Monty Taylor

You can do it with temporary tables.

Like this-

create temporary table foo (
  note_id int,
  notes varchar
);
insert into foo select Note.note_id, Note.notes from Note, Artist
  where Note.note_id=Artist.note_id and Artist.artist_id=23;
update foo set notes="asdlfna";
replace into Note select note_id, notes from foo;

This does assume that the note_id is unique.
You may also need to explicitly drop foo, because it goes away when you
disconnect, but of course  Zope holds connections open.

!!! However -- now that I think of it... you can just do:
replace into Note select note_id, "New Note" from Artist where artist_id=23;

Of couse, this will change all notes for an artist, so it assumes the
artist_id is unique as well. (Which I would assume it is from your model.)

If you need more complex things, look into temporary tables, but the MySQL
extension (like replace) do allow you to do fun things.

Hope this helps,
Monty

Richard Moon wrote:

> Nice idea. Trouble is the note table is used to hold notes for many
> different reasons, so it looks like this -
>
>   ---   
> | Artist| | Recording  |  | Label  |   etc.
>   ---   
> | artist_id | |recording_id|  |label_id|
> | note_id   | |note_id |  |note_id |
>   ---   
>   |   ||  |   |
>-
> |
> --
>| Note |
> --
>| note_id  |
>| notes|
> --
>
> It looks as if there wasn't anything I was missing - I'm just going to have
> to break the code up into separate SQL Methods.
>
> The example I gave was quite simple compared to some of the updates I have
> to deal with.
>
> Thanks anyway.
>
> At 17:40 16/10/00, you wrote:
> >Or you could renormalize your data to have:
> >
> >  - ---
> >|  Artist |   |  Note |
> >|-|---|---|
> >|  id |   | id|
> >  -| artist_id |
> >   | note_str  |
> >---
> >
> >you now have a list of notes by artist_id.
> >You typically won't have a screen that doesn't have an Artist context
> >to be adding a note to. (or to remove all notes from).
> >Of course this means more work to migrate :-(
> >And I don't know all possible scenarios for which you would
> >need the structure you gave, but it is another way around this.
> >It probably doesn't solve real complex scenarios either.
> >
> >JAT
> >
> >Dale
>
> Richard Moon
> [EMAIL PROTECTED]
>
> ___
> Zope maillist  -  [EMAIL PROTECTED]
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] MySQL and Zope struggles

2000-10-16 Thread Richard Moon



Nice idea. Trouble is the note table is used to hold notes for many 
different reasons, so it looks like this -

  ---   
| Artist| | Recording  |  | Label  |   etc.
  ---   
| artist_id | |recording_id|  |label_id|
| note_id   | |note_id |  |note_id |
  ---   
  |   ||  |   |
   -
|
--
   | Note |
--
   | note_id  |
   | notes|
--

It looks as if there wasn't anything I was missing - I'm just going to have 
to break the code up into separate SQL Methods.

The example I gave was quite simple compared to some of the updates I have 
to deal with.

Thanks anyway.




At 17:40 16/10/00, you wrote:
>Or you could renormalize your data to have:
>
>  - ---
>|  Artist |   |  Note |
>|-|---|---|
>|  id |   | id|
>  -| artist_id |
>   | note_str  |
>---
>
>you now have a list of notes by artist_id.
>You typically won't have a screen that doesn't have an Artist context
>to be adding a note to. (or to remove all notes from).
>Of course this means more work to migrate :-(
>And I don't know all possible scenarios for which you would
>need the structure you gave, but it is another way around this.
>It probably doesn't solve real complex scenarios either.
>
>JAT
>
>Dale


Richard Moon
[EMAIL PROTECTED]



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] MySQL and Zope struggles

2000-10-16 Thread dale . w . lance

Or you could renormalize your data to have:

 - ---
|  Artist |   |  Note |
|-|---|---|
|  id |   | id|
 -| artist_id |
  | note_str  |
   ---

you now have a list of notes by artist_id.
You typically won't have a screen that doesn't have an Artist context
to be adding a note to. (or to remove all notes from).
Of course this means more work to migrate :-(
And I don't know all possible scenarios for which you would
need the structure you gave, but it is another way around this.
It probably doesn't solve real complex scenarios either.

JAT

Dale

-Original Message-
From: administrator [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 16, 2000 6:11 AM
To: zope
Cc: administrator
Subject: Re: [Zope] MySQL and Zope struggles


I don't know if the following link can solve your problem,
but maybe it gives you an idea:
http://www.zope.org/Members/Roug/new_record_with_subrecords
(How-To: Creating a new record with subrecords in MySQL)
 Arno


> I'm struggling to migrate an application from Zope/PostgreSQL to Zope 
MySQL
> (Why ? - because I've got a kind offer of free hosting if I use 
MySQL).
>
> MySQL offers a limited set of features and is missing, among other 
things,
> the ability to use subqueries - so for example in PostgreSQL you can 
say
>
> update note set notes =
>  where note_id =
>  (select note_id from artist where )
>
> and in MySQL you can't.
>
> If you were working in a traditional programming environment you could
> overcome this by splitting the above into two parts - a select to 
retrieve
> the value of note_id from the artist table followed by an update of 
the
> note table using the returned value of note-id.
>
> For example
>
> select note-id into note-id-var from artist where artist-id = 23;
> update note set notes = 'asdasda' where note-id = note-id-var;
>
> The problem is that in Zope I believe you can't use a returned value 
within
> an SQL Method,  so the above code would fail. The only way I can see 
to do
> the above is to have two separate SQL Methods, one for the select,
> returning the note-id-var and another for the update. This is very 
clumsy.
>
> I was wondering if anyone could tell me if there was a better way.
>
> Many thanks
>
>
> Richard
>
> Richard Moon
> [EMAIL PROTECTED]
>
>
>
> ___
> Zope maillist  -  [EMAIL PROTECTED]
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>
>
> To: [EMAIL PROTECTED]



Re: [Zope] MySQL and Zope struggles

2000-10-16 Thread administrator

I don't know if the following link can solve your problem,
but maybe it gives you an idea:
http://www.zope.org/Members/Roug/new_record_with_subrecords
(How-To: Creating a new record with subrecords in MySQL)
 Arno


> I'm struggling to migrate an application from Zope/PostgreSQL to Zope MySQL
> (Why ? - because I've got a kind offer of free hosting if I use MySQL).
>
> MySQL offers a limited set of features and is missing, among other things,
> the ability to use subqueries - so for example in PostgreSQL you can say
>
> update note set notes =
>  where note_id =
>  (select note_id from artist where )
>
> and in MySQL you can't.
>
> If you were working in a traditional programming environment you could
> overcome this by splitting the above into two parts - a select to retrieve
> the value of note_id from the artist table followed by an update of the
> note table using the returned value of note-id.
>
> For example
>
> select note-id into note-id-var from artist where artist-id = 23;
> update note set notes = 'asdasda' where note-id = note-id-var;
>
> The problem is that in Zope I believe you can't use a returned value within
> an SQL Method,  so the above code would fail. The only way I can see to do
> the above is to have two separate SQL Methods, one for the select,
> returning the note-id-var and another for the update. This is very clumsy.
>
> I was wondering if anyone could tell me if there was a better way.
>
> Many thanks
>
>
> Richard
>
> Richard Moon
> [EMAIL PROTECTED]
>
>
>
> ___
> Zope maillist  -  [EMAIL PROTECTED]
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>
>
> To: [EMAIL PROTECTED]



Re: [Zope] mySQL - Z SQL - dtml-var

2000-07-17 Thread Dieter Maurer

Gijs Reulen writes:
 > INSERT INTO test1
 > ( id, content, phone )
 > VALUES (
 > ,
 > ,
 > 
 > )
 > 
 > According to the doc I should be able to use dtml-var statements in Z SQL
 > Methods. However, this returns an error: Error, exceptions.KeyError: 12.12
This is indeed a strange variable name (12.12).

Do you mean the floating point value 12.12 rather than a variable of
this name?

In this case, you should use:
  

 > I also tried:
 > INSERT INTO test1
 > ( id, content, phone )
 > VALUES (
 > ,
 > ,
 > 
 > )
 > 
 > This also retuns an error: Error, exceptions.ValueError: Invalid
 > floating-point value for id
Obviously, "id" does not contain a floating point value.



Dieter

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] MySQL LIKE operator

2000-07-13 Thread Phill Hugo

> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, July 12, 2000 11:03 AM
> > To: [EMAIL PROTECTED]
> > Subject: [Zope] MySQL LIKE operator
> >
> >
> > Hello,
> >
> > I'm writing a search query to a MySQL database.  I want to keep
> > people from screwing around with my database by running searches like ";
> > delete from ... yada yada.  So I should use , right?  But
> > what if I want to use LIKE?
> >   If I say:  WHERE goo LIKE "%%"  then
> > effectively I am saying: WHERE goo LIKE "%'somestring'%".  In other
> > words, it will match only the string with the single quotes.  I hope
> > this makes sense.  Has anyone faced a similar problem?
> >   Thanks for any help
> >
> > --Aaron

Here's a sample of some larger scale SQL with just the thing your
looking for in it.

SELECT *
FROM users

 
 
 
 user_name LIKE 
 

 
 user_firstname LIKE 
 

 
 user_lastname LIKE 
 

 
 user_age LIKE 
 

 
 user_town LIKE 
 

 
 user_email LIKE 
 

ORDER BY
user_name

Hope this helps

Phill

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] MySQL LIKE operator

2000-07-12 Thread Ron Bickers

You should be able to use something like this (untested):



That way you get the SQL quoting without the surrounding quotes.

___

Ron Bickers
Logic Etc, Inc.
[EMAIL PROTECTED]


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 12, 2000 11:03 AM
> To: [EMAIL PROTECTED]
> Subject: [Zope] MySQL LIKE operator
> 
> 
> Hello,
> 
> I'm writing a search query to a MySQL database.  I want to keep
> people from screwing around with my database by running searches like ";
> delete from ... yada yada.  So I should use , right?  But
> what if I want to use LIKE?
>   If I say:  WHERE goo LIKE "%%"  then
> effectively I am saying: WHERE goo LIKE "%'somestring'%".  In other
> words, it will match only the string with the single quotes.  I hope
> this makes sense.  Has anyone faced a similar problem?
>   Thanks for any help
> 
> --Aaron
> 
> 
> ___
> Zope maillist  -  [EMAIL PROTECTED]
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
> 
> 

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] MySQL transaction support (was: MySQL Select Statements)

2000-07-04 Thread Monty Taylor



>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<

On 7/4/00, 12:47:07 AM, Andy Dustman <[EMAIL PROTECTED]> wrote regarding 
Re: [Zope] MySQL transaction support (was: MySQL Select Statements):

> Note also: With non-transactional databases, you would expect to get
> better performance by having several open connections which are not
> shared. In the case of MySQL, each connection has it's own server thread,
> and this can exploit CPUs, if available. However, connections should not
> be shared on transactional databases, because transactions are tied to a
> connection, and not a cursor. Even if there is a mutex to keep multiple
> threads from executing queries simultaneously on the same connection, the
> transactions are going to be whacky.

Oracle is obviously transactional. Does anyone know how it handles 
connection pooling? I'll look and see it I can figure it out, but I'd 
love it if someone already knew...

Monty

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] MySQL Select Statements

2000-07-03 Thread Andy Dustman

On Sat, 1 Jul 2000, Dieter Maurer wrote:

> I recently found out that Oracle returns column names
> converted into all uppercase. I needed about 2 hours
> to analyse this weird behaviour.

That's actually not too weird. Solid does the same thing. It is a standard
"feature" of SQL-89 that column names are case-insensitive and stored as
upper case. You can force it to use mixed-case and spaces by quoting the
column names with quotation marks. Of course, you have to do this when you
CREATE TABLE. i.e.

SELECT "weird but legal" FROM t

selects the column named "weird but legal" from table t.

MySQL, OTOH, is case-sensitive on column names.

-- 
andy dustman   | programmer/analyst |  comstar.net, inc.
telephone: 770.485.6025 / 706.549.7689 | icq: 32922760 | pgp: 0xc72f3f1d
"Therefore, sweet knights, if you may doubt your strength or courage, 
come no further, for death awaits you all, with nasty, big, pointy teeth!"


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] MySQL transaction support (was: MySQL Select Statements)

2000-07-03 Thread Andy Dustman

On Tue, 4 Jul 2000, Hannu Krosing wrote:

> AFAIK the transaction support is enabled on table-by-table basis, so
> there 
> is no way to know for sure if transactions are 
> supported/partially-supported/unsupported for a particular set of
> queries

True enough. There are several problems here:

1) We must avoid using BEGIN/COMMIT/ROLLBACK on servers < 3.23.15 because
it will result in syntax errors.

2) We must raise exceptions whenever the DA attempts to use transacation
semantics and the database cannot fulfill this. Silently allowing the
transaction manager to believe ROLLBACK has succeeded when it is actually
doing nothing is a bad thing.

3) Even though the server may support transactions, the tables may not.
Calling ROLLBACK hopefully produces an error, which is a good thing.

4) Calling ROLLBACK in AUTOCOMMIT mode probably does not produce an error.
This is bad, but easily avoided by using BEGIN to force a transaction.
Does this cause MySQL to produce an error if the tables don't support it?
I don't know. Probably not.

IMHO, the only good way to avoid these problems is to effectively have two
DAs: A transactional one and a non-transactional one, perhaps determined
by a Zope property. The application designer will have to choose which DA
to use for a given application.

Note also: With non-transactional databases, you would expect to get
better performance by having several open connections which are not
shared. In the case of MySQL, each connection has it's own server thread,
and this can exploit CPUs, if available. However, connections should not
be shared on transactional databases, because transactions are tied to a
connection, and not a cursor. Even if there is a mutex to keep multiple
threads from executing queries simultaneously on the same connection, the
transactions are going to be whacky.

-- 
andy dustman   | programmer/analyst |  comstar.net, inc.
telephone: 770.485.6025 / 706.549.7689 | icq: 32922760 | pgp: 0xc72f3f1d
"Therefore, sweet knights, if you may doubt your strength or courage, 
come no further, for death awaits you all, with nasty, big, pointy teeth!"


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] MySQL transaction support (was: MySQL Select Statements)

2000-07-03 Thread Hannu Krosing

Andy Dustman wrote:
> 
> There are two factors which determine whether or not transactions can be
> supported. Actually, there's only one, but it can't be directly tested
> for:
> 
> 1) If the server version (easily obtained upon establishing the
> connection) is < 3.23.15, transactions are definitely not supported.
> 
> 2) If the database in use employs BDB tables, transactions are definitely
> supported.

AFAIK the transaction support is enabled on table-by-table basis, so
there 
is no way to know for sure if transactions are 
supported/partially-supported/unsupported for a particular set of
queries

> The problem is: Support for the transaction manager is done with a MixIN
> class, so the decision on whether or not transactions should be supported
> in the DA comes before the connection object is created. 

But after the connection is established you could probably change the
mixin 
class, at least if it is really a proxy wrapper of some other class.

Python is _very_ dynamic language.


Hannu

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] MySQL transaction support (was: MySQL Select Statements)

2000-07-03 Thread Andy Dustman

On Mon, 3 Jul 2000, Monty Taylor wrote:

> Why not have one ZmySQLDA that attempts to determine whether it is 
> transactional or not when the connect method is executed. That way you 
> could have a DA connect to your 3.22 database, upgrade your database to 
> >3.23.15 and not see any problems. A combination of try-except:ing an 
> attempted "begin rollback" block and a test for database type should do 
> the trick, no? If it's 3.22 or earlier, the begin-rollback should throw 
> the synax error Andy mentioned. If that's ok, a test for database type 
> (not sure about this one) to see if it's BDB? If all of this is wrapped 
> in the connect method, we should be able to make it 'do the right thing' 

There are two factors which determine whether or not transactions can be
supported. Actually, there's only one, but it can't be directly tested
for:

1) If the server version (easily obtained upon establishing the
connection) is < 3.23.15, transactions are definitely not supported.

2) If the database in use employs BDB tables, transactions are definitely
supported.

The problem is: Support for the transaction manager is done with a MixIN
class, so the decision on whether or not transactions should be supported
in the DA comes before the connection object is created. Which raises an
interesting possibility: On the connection object's Properties tab, add a
checkbox which indicates that transactional semantics are required. The
status of this checkbox determines which class is used for the database
connection. This might be workable, not really sure.

-- 
andy dustman   | programmer/analyst |  comstar.net, inc.
telephone: 770.485.6025 / 706.549.7689 | icq: 32922760 | pgp: 0xc72f3f1d
"Therefore, sweet knights, if you may doubt your strength or courage, 
come no further, for death awaits you all, with nasty, big, pointy teeth!"


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] MySQL transaction support (was: MySQL Select Statements)

2000-07-03 Thread Monty Taylor

Why not have one ZmySQLDA that attempts to determine whether it is 
transactional or not when the connect method is executed. That way you 
could have a DA connect to your 3.22 database, upgrade your database to 
>3.23.15 and not see any problems. A combination of try-except:ing an 
attempted "begin rollback" block and a test for database type should do 
the trick, no? If it's 3.22 or earlier, the begin-rollback should throw 
the synax error Andy mentioned. If that's ok, a test for database type 
(not sure about this one) to see if it's BDB? If all of this is wrapped 
in the connect method, we should be able to make it 'do the right thing' 

Thoughts?

Monty


> > with BDB tables. But it may be possible to break things down as having a
> > DA for 3.22 and one for 3.23. Which is, in practice, may not be any
> > different than having one that is not transactional (3.22 never is) and
> > one that is transactional (3.23 sometimes is).

> What I want to avoid is having to create two different "MySQL database
> connections" where I have to choose the "correct" one based on whether or
> not my SQL method is using transactions or not.  I'll most likely only be
> using one version of MySQL at a time, but if I'm using transactions at 
all,
> there's a good chance not all of my tables will support them.

> I guess we'll just have to do some testing.
> ___

> Ron Bickers
> Logic Etc, Inc.
> [EMAIL PROTECTED]


> ___
> Zope maillist  -  [EMAIL PROTECTED]
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] MySQL Select Statements

2000-06-30 Thread Dieter Maurer

Michael Blewett writes:
 > Select Column1, Column2 etc
 > from TableA.
 > 
 > Instead I must use the AS statement ie
 > 
 > Select Column1 AS Column1, Column2 AS Column2
 > from TableA.
Zope should not be responsible for this strange behaviour.

It simply executes the SQL statement and asks the result
for the result column names. It then wraps each result
row in an object that allows to access a column value
as attribute under the respective column name.

You could try:

  

to get the list of column names your Z SQL Method
"SQLMethod" returns.

This may give you a hint how your database names result columns.


I recently found out that Oracle returns column names
converted into all uppercase. I needed about 2 hours
to analyse this weird behaviour.



Dieter

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] MySQL transaction support (was: MySQL Select Statements)

2000-06-30 Thread Ron Bickers

> -Original Message-
> From: Andy Dustman [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 30, 2000 4:08 PM
> To: Ron Bickers
> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: [Zope] MySQL transaction support (was: MySQL Select
> Statements)

> with BDB tables. But it may be possible to break things down as having a
> DA for 3.22 and one for 3.23. Which is, in practice, may not be any
> different than having one that is not transactional (3.22 never is) and
> one that is transactional (3.23 sometimes is).

What I want to avoid is having to create two different "MySQL database
connections" where I have to choose the "correct" one based on whether or
not my SQL method is using transactions or not.  I'll most likely only be
using one version of MySQL at a time, but if I'm using transactions at all,
there's a good chance not all of my tables will support them.

I guess we'll just have to do some testing.
___

Ron Bickers
Logic Etc, Inc.
[EMAIL PROTECTED]


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] MySQL transaction support (was: MySQL Select Statements)

2000-06-30 Thread Andy Dustman

On Fri, 30 Jun 2000, Ron Bickers wrote:

> > That's the problem: They don't get control over when BEGIN/COMMIT/ROLLBACK
> > are used. Zope does that if you are using the Transaction Manager. And the
> > only way to control use of the Transaction Manager is by
> > selection of DA.
> >
> > That's why I think it may be necessary to have two ZMySQLDAs: One which is
> > transactional and one which is not. However, they can both be part of the
> > same distribution, and the transactional one can simply subclass the
> > non-transactional one (mixing in the TM base and adding the required
> > methods), so there is not a lot of code duplication.
> 
> I see.  So how would this affect use of transaction and non-transaction
> supporting tables?  Would two separate database connections be required
> where the SQLMethod must use the correct connection depending on transaction
> support?
> 
> Making assumptions is bad, but suppose MySQL 3.23 does something elegant
> with BEGIN/COMMIT/ROLLBACK attempts on non-transaction supporting tables
> (like return a "table does not support transactions" or simply ignores that
> statement).  Could we then just have one DA for 3.22 and another for 3.23,
> where the 3.23 DA handles transactions, but silently ignores them when
> dealing with non-transaction tables?

These are good questions. But I don't have good answers yet. I tried BEGIN
and COMMIT when I didn't even have a database selected, and it took it. It
may silently accept ROLLBACK when rollback is impossible, or it may raise
an error. I haven't done that much testing with MySQL-3.23 yet, and none
with BDB tables. But it may be possible to break things down as having a
DA for 3.22 and one for 3.23. Which is, in practice, may not be any
different than having one that is not transactional (3.22 never is) and
one that is transactional (3.23 sometimes is).

-- 
andy dustman   | programmer/analyst |  comstar.net, inc.
telephone: 770.485.6025 / 706.549.7689 | icq: 32922760 | pgp: 0xc72f3f1d
"Therefore, sweet knights, if you may doubt your strength or courage, 
come no further, for death awaits you all, with nasty, big, pointy teeth!"


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] MySQL transaction support (was: MySQL Select Statements)

2000-06-30 Thread Ron Bickers

> -Original Message-
> From: Andy Dustman [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 30, 2000 1:25 PM
> To: Ron Bickers
> Cc: Michael Blewett; [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: [Zope] MySQL Select Statements

> That's the problem: They don't get control over when BEGIN/COMMIT/ROLLBACK
> are used. Zope does that if you are using the Transaction Manager. And the
> only way to control use of the Transaction Manager is by
> selection of DA.
>
> That's why I think it may be necessary to have two ZMySQLDAs: One which is
> transactional and one which is not. However, they can both be part of the
> same distribution, and the transactional one can simply subclass the
> non-transactional one (mixing in the TM base and adding the required
> methods), so there is not a lot of code duplication.

I see.  So how would this affect use of transaction and non-transaction
supporting tables?  Would two separate database connections be required
where the SQLMethod must use the correct connection depending on transaction
support?

Making assumptions is bad, but suppose MySQL 3.23 does something elegant
with BEGIN/COMMIT/ROLLBACK attempts on non-transaction supporting tables
(like return a "table does not support transactions" or simply ignores that
statement).  Could we then just have one DA for 3.22 and another for 3.23,
where the 3.23 DA handles transactions, but silently ignores them when
dealing with non-transaction tables?

___

Ron Bickers
Logic Etc, Inc.
[EMAIL PROTECTED]


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] MySQL Select Statements

2000-06-30 Thread Andy Dustman

On Fri, 30 Jun 2000, Ron Bickers wrote:

> It should be as simple as the application designer actually knowing what
> they're doing by knowing whether or not they're working with a table that
> supports transactions or not, and just not using BEGIN/COMMIT/ROLLBACK when
> they're not.  Or is it too much to ask that designers know what they're
> doing? :-)

That's the problem: They don't get control over when BEGIN/COMMIT/ROLLBACK
are used. Zope does that if you are using the Transaction Manager. And the
only way to control use of the Transaction Manager is by selection of DA.  
That's why I think it may be necessary to have two ZMySQLDAs: One which is
transactional and one which is not. However, they can both be part of the
same distribution, and the transactional one can simply subclass the
non-transactional one (mixing in the TM base and adding the required
methods), so there is not a lot of code duplication.

In addition, a lot of people are still going to be using MySQL-3.22, which
does NOT support transactions, or even the BEGIN/COMMIT/ROLLBACK
statements (these produce syntax errors). The only way to detect this at
runtime is to look at the server's version. Anyway, more experimenting is
needed.

-- 
andy dustman   | programmer/analyst |  comstar.net, inc.
telephone: 770.485.6025 / 706.549.7689 | icq: 32922760 | pgp: 0xc72f3f1d
"Therefore, sweet knights, if you may doubt your strength or courage, 
come no further, for death awaits you all, with nasty, big, pointy teeth!"


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] MySQL Select Statements

2000-06-30 Thread Ron Bickers

> -Original Message-
> From: Andy Dustman [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 30, 2000 11:42 AM
> To: Michael Blewett
> Cc: Ron Bickers; [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: [Zope] MySQL Select Statements
>

> It's a matter of perspective. I prefer to think of it as 0.2.2 breaks
> ZMySQLDA. This is because ZMySQLDA uses _mysql, and _mysql prior to 0.2.2
> implemented fetch_row(), fetch_rows(), fetch_all_rows(), and the
> ..._as_dict() variants.

Thanks for clarifying that.  I hope the 1.2.0 DA continues to follow your
(Andy's) changes to the MySQLdb so that we can have a nice, working, stable
db/DA combination.

> what the solution is for this. It may be necessary to have the ZMySQLDA
> package include another DA: ZMySQLTDA for transactions. The standard DA

Please not two DAs just for the difference in transaction support.

> Obviously the application designer will have to use the right DA for the
> right table type...

It should be as simple as the application designer actually knowing what
they're doing by knowing whether or not they're working with a table that
supports transactions or not, and just not using BEGIN/COMMIT/ROLLBACK when
they're not.  Or is it too much to ask that designers know what they're
doing? :-)

___

Ron Bickers
Logic Etc, Inc.
[EMAIL PROTECTED]


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] MySQL Select Statements

2000-06-30 Thread Andy Dustman

I should point out that 0.2.2 has not been fully released yet. There's a
bug I have to iron out of it first. Probably next week. Also, for general
MySQLdb questions, send them to [EMAIL PROTECTED] (mailing list). Or
subscribe, it's low-volume and won't fatten your mailbox.

On Fri, 30 Jun 2000, Michael Blewett wrote:

> It's funny that you say 0.2.2 is broken. Apart from this one glitch, it 
> works fine for me (although from memory I think we had to do a little bit 
> of fiddling at install time to get it to work).

It's a matter of perspective. I prefer to think of it as 0.2.2 breaks
ZMySQLDA. This is because ZMySQLDA uses _mysql, and _mysql prior to 0.2.2
implemented fetch_row(), fetch_rows(), fetch_all_rows(), and the
..._as_dict() variants. This was just too much code duplication to put up
with, and the new interface is fetch([n[,how]]) where n is the maximum
number of rows to fetch (default 1), and how is how to return the result
(0: as tuple, 1: as dictionary, other codes may be added at some point).
To fix ZMySQLDA, change fetch_all_rows() to fetch(maxrows) in the query
routine. One other place (to get the tables) uses fetch_all_rows(). If you
insist on using 0.2.2 at this point, change that as well. 0.2.2 is marked
Alpha for a reason... And when I release it, I'll include a very small
patch to make things right with ZMySQLDA again (I'm treating mordred's as
the official one at this point).
 
> At 00:12 30/06/2000 -0400, Ron Bickers wrote:
> >Why do you say you "must" use the AS statement?  Do you get an error
> >otherwise?
> >
> >MySQLdb 0.2.2 is broken when used with ZMySQLDA.  But 0.2.1 works okay for
> >me.  Andy Dustman (author of the MySQLdb) said he will fix it and hinted
> >that one should use the ZMySQLDA that is on Zope.org (v1.2.0 now I believe).
> >Since that one now uses his MySQLdb, he will likely kill off his own DA.

Quite true. Now for the AS statement: If you are joining tables with
identically-named columns in common, you should use AS in your SQL to
rename them. Otherwise it will return two columns with the same name to
Zope, which is bad. You do not, however, need to do this:

> > > Just need someone to put me straight here. When I use Select
> > > statements in
> > > an SQL Method I cannot simply :
> > >
> > > Select Column1, Column2 etc
> > > from TableA.
> > >
> > > Instead I must use the AS statement ie
> > >
> > > Select Column1 AS Column1, Column2 AS Column2
> > > from TableA.
> > >
> > >   - Michael

This is just gratuitious renaming to the original name, which is not
renaming at all. Here's an example of what I'm talking about.

SELECT TableA.Col, TableB.Col from TableA, TableB # bad
SELECT TableA.Col AS ColA, TableB.Col AS ColB from TableA, TableB # good

Note that the first SELECT returned two columns named Col, which will
confuse Zope, and the second returns ColA (TableA.Col) and ColB
(TableB.Col).

Additional compatibility note: One of the 0.2.2 changes has been to
synchronize with MySQL-3.23 evolution (now at 3.23.19-beta, and GPL'd),
and the big feature here is: Transactions! Yes, as of 3.23.15,
transactions are in MySQL, if you use BDB tables. And yes, BDB does mean
Berkeley DB, specificially the Sleepycat DB v3, which supports
transactions (but probably not columns, which I presume MySQL is imposing
on the database).

For ZMySQLDA developers out there; MySQL-3.23 defaults to autocommit.
However, there is a BEGIN SQL statement which starts a transaction and
similarly for COMMIT and ROLLBACK statements. But remember: All this
transactional stuff ONLY works on BDB tables. If you try to BEGIN a
transaction (or turn off autocommit) on another table type, well, I'm not
sure what happens. Maybe you get an error, and maybe you don't. Not sure
what the solution is for this. It may be necessary to have the ZMySQLDA
package include another DA: ZMySQLTDA for transactions. The standard DA
would not be based on TM, and the transactional one could simply subclass
the other one:

# ZMySQLTDA/db.py
from Shared.DC.ZRDB.TM import TM

class DB(ZMySQLDA.DB, TM):

def _begin(self, *ignored): self.db.query("BEGIN")
def _finish(self, *ignored): self.db.query("COMMIT")
def _abort(self, *ignored): self.db.query("ROLLBACK")

Obviously the application designer will have to use the right DA for the
right table type...

-- 
andy dustman   | programmer/analyst |  comstar.net, inc.
telephone: 770.485.6025 / 706.549.7689 | icq: 32922760 | pgp: 0xc72f3f1d
"Therefore, sweet knights, if you may doubt your strength or courage, 
come no further, for death awaits you all, with nasty, big, pointy teeth!"


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] MySQL Select Statements

2000-06-29 Thread Ron Bickers


> If I don't specify my Selects using "AS", I then get the following error
> message:
>
> Error Type: KeyError
> Error Value: SubjectName

Traceback (innermost last):
   File /usr/local/Zope-2.1.6-linux2-x86/lib/python/ZPublisher/Publish.py,
line 214, in publish_module
   File /usr/local/Zope-2.1.6-linux2-x86/lib/python/ZPublisher/Publish.py,
line 179, in publish

...

I overlooked that you are running 2.1.6.  I don't know about the error
message you're getting so this may be unrelated, but I and many many others
have had a lot of problems with 2.1.6 and ZSQLMethods.  So many that I stuck
with 2.1.4 and I'll skip directly to 2.2.

> It's funny that you say 0.2.2 is broken. Apart from this one glitch, it
> works fine for me (although from memory I think we had to do a little bit
> of fiddling at install time to get it to work).

I don't know a whole lot about the problem, but fetch_all_rows() is missing,
and for whatever reason that breaks my methods.  If it's working for you,
then great.  I don't guess that helps you with your problem though.  Did you
have this problem with 2.1.4?

___

Ron Bickers
Logic Etc, Inc.
[EMAIL PROTECTED]


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] MySQL Select Statements

2000-06-29 Thread Michael Blewett

At 14:08 30/06/2000 +1000, Curtis Maloney wrote:

> > Is this just an oddity with the MySQLDA/Db adapters or am I overlooking
> > something blatantly obvious here? All the examples on zope.org don't have
> > the extra "AS Column1" additions on them and I was wondering if this is a
> > Zope/mySQL-unique thing.
>
>Can you try to construct the simplest example of a query that doesn't work?
Sure. Here tis:

select Subject,
Subjectname

from test
order by Subject

> >
> > I'm using Zope (2.1.6) with MySQL (3.22.32) with Zope MySQL Database
> > Adapter (ZMySQLDA) 2.0.0a1 and
> > MySQLdb module release: 0.2.2 .
>
>Hmm.. I am using the same, except for ZMySQLda 1.1.3, and MySQLdb 0.1.2.  So,
>perhaps it's new in ZMySQLda 2.0.

Quite possibly. I've sent a cc to Andy Dustman, just in case he's interested.

> > Could someone please let me know as I don't want to have to type the extra
> > bits on all my SQL statements from here on in if I don't need to (I am the
> > world's worst and laziest typist). If it is the case that it's a necessary
>
>What, you've never heard of cut'n'paste? (o8

With two fields it's OK, but if you've got 30 fields in a table it gets 
pretty tiresome (even using cut & paste)   :o)


> > evil, then I want to put a HowTo or Tip up on zope.org because it took me a
> > while to figure out what I was doing wrong, and if I can save someone else
> > that same wasted time then I would like to. However I wanted to get my
> > facts straight (via all you experts) first.
>
>A wise move, and a wonderful gesture.

That's how 'collaborative' software should work IMHO.

>Have a better one,
No - *you* have an even better one,
Thanks for the reply...

  - Michael
~~~
Michael Blewett
Computer Support Mgr - Biological Sciences
Monash University (Clayton Campus)
Victoria Australia 3168

" Can I trade this job for what's behind door #2? "


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] MySQL Select Statements

2000-06-29 Thread Michael Blewett

Hi Ron,
If I don't specify my Selects using "AS", I then get the following error 
message:

Error Type: KeyError
Error Value: SubjectName

Traceback (innermost last):
   File /usr/local/Zope-2.1.6-linux2-x86/lib/python/ZPublisher/Publish.py, 
line 214, in publish_module
   File /usr/local/Zope-2.1.6-linux2-x86/lib/python/ZPublisher/Publish.py, 
line 179, in publish
   File /usr/local/Zope-2.1.6-linux2-x86/lib/python/Zope/__init__.py, line 
202, in zpublisher_exception_hook
 (Object: ElementWithAttributes)
   File /usr/local/Zope-2.1.6-linux2-x86/lib/python/ZPublisher/Publish.py, 
line 165, in publish
   File /usr/local/Zope-2.1.6-linux2-x86/lib/python/ZPublisher/mapply.py, 
line 160, in mapply
 (Object: dtTestList)
   File /usr/local/Zope-2.1.6-linux2-x86/lib/python/ZPublisher/Publish.py, 
line 102, in call_object
 (Object: dtTestList)
   File /usr/local/Zope-2.1.6-linux2-x86/lib/python/OFS/DTMLDocument.py, 
line 166, in __call__
 (Object: dtTestList)
   File 
/usr/local/Zope-2.1.6-linux2-x86/lib/python/DocumentTemplate/DT_String.py, 
line 502, in __call__
 (Object: dtTestList)
   File 
/usr/local/Zope-2.1.6-linux2-x86/lib/python/DocumentTemplate/DT_In.py, line 
691, in renderwob
 (Object: sqlRetrieveTestList)
KeyError: (see above)


(Where Subjectname was the first field referenced in the DTML document).
Whereas, If I put the SQL as
Select Subjectname AS Subjectname,  etc, then it all works fine.

It's funny that you say 0.2.2 is broken. Apart from this one glitch, it 
works fine for me (although from memory I think we had to do a little bit 
of fiddling at install time to get it to work).


  - Michael


At 00:12 30/06/2000 -0400, Ron Bickers wrote:
>Why do you say you "must" use the AS statement?  Do you get an error
>otherwise?
>
>MySQLdb 0.2.2 is broken when used with ZMySQLDA.  But 0.2.1 works okay for
>me.  Andy Dustman (author of the MySQLdb) said he will fix it and hinted
>that one should use the ZMySQLDA that is on Zope.org (v1.2.0 now I believe).
>Since that one now uses his MySQLdb, he will likely kill off his own DA.
>
>___
>
>Ron Bickers
>Logic Etc, Inc.
>[EMAIL PROTECTED]
>
>
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
> > Michael Blewett
> > Sent: Thursday, June 29, 2000 10:53 PM
> > To: [EMAIL PROTECTED]
> > Subject: [Zope] MySQL Select Statements
> >
> >
> > Hi Everyone,
> > Just need someone to put me straight here. When I use Select
> > statements in
> > an SQL Method I cannot simply :
> >
> > Select Column1, Column2 etc
> > from TableA.
> >
> > Instead I must use the AS statement ie
> >
> > Select Column1 AS Column1, Column2 AS Column2
> > from TableA.
> >
> > Is this just an oddity with the MySQLDA/Db adapters or am I overlooking
> > something blatantly obvious here? All the examples on zope.org don't have
> > the extra "AS Column1" additions on them and I was wondering if this is a
> > Zope/mySQL-unique thing.
> >
> > I'm using Zope (2.1.6) with MySQL (3.22.32) with Zope MySQL Database
> > Adapter (ZMySQLDA) 2.0.0a1 and
> > MySQLdb module release: 0.2.2 .
> >
> > Could someone please let me know as I don't want to have to type
> > the extra
> > bits on all my SQL statements from here on in if I don't need to
> > (I am the
> > world's worst and laziest typist). If it is the case that it's a
> > necessary
> > evil, then I want to put a HowTo or Tip up on zope.org because it
> > took me a
> > while to figure out what I was doing wrong, and if I can save
> > someone else
> > that same wasted time then I would like to. However I wanted to get my
> > facts straight (via all you experts) first.
> >
> > Thanks for any help...
> >
> >   - Michael
> > ~~~
> > Michael Blewett
> > Computer Support Mgr - Biological Sciences
> > Monash University (Clayton Campus)
> > Victoria Australia 3168
> >
> > " Can I trade this job for what's behind door #2? "
> >
> >
> > ___
> > Zope maillist  -  [EMAIL PROTECTED]
> > http://lists.zope.org/mailman/listinfo/zope
> > **   No cross posts or HTML encoding!  **
> > (Related lists -
> >  http://lists.zope.org/mailman/listinfo/zope-announce
> >  http://lists.zope.org/mailman/listinfo/zope-dev )
> >
> >

~~~
Michael Blewett
Computer Support Mgr - Biological Sciences
Monash University (Clayton Campus)
Victoria Australia 3168

" Can I trade this job for what's behind door #2? "


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] MySQL Select Statements

2000-06-29 Thread Ron Bickers

Why do you say you "must" use the AS statement?  Do you get an error
otherwise?

MySQLdb 0.2.2 is broken when used with ZMySQLDA.  But 0.2.1 works okay for
me.  Andy Dustman (author of the MySQLdb) said he will fix it and hinted
that one should use the ZMySQLDA that is on Zope.org (v1.2.0 now I believe).
Since that one now uses his MySQLdb, he will likely kill off his own DA.

___

Ron Bickers
Logic Etc, Inc.
[EMAIL PROTECTED]


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
> Michael Blewett
> Sent: Thursday, June 29, 2000 10:53 PM
> To: [EMAIL PROTECTED]
> Subject: [Zope] MySQL Select Statements
>
>
> Hi Everyone,
> Just need someone to put me straight here. When I use Select
> statements in
> an SQL Method I cannot simply :
>
> Select Column1, Column2 etc
> from TableA.
>
> Instead I must use the AS statement ie
>
> Select Column1 AS Column1, Column2 AS Column2
> from TableA.
>
> Is this just an oddity with the MySQLDA/Db adapters or am I overlooking
> something blatantly obvious here? All the examples on zope.org don't have
> the extra "AS Column1" additions on them and I was wondering if this is a
> Zope/mySQL-unique thing.
>
> I'm using Zope (2.1.6) with MySQL (3.22.32) with Zope MySQL Database
> Adapter (ZMySQLDA) 2.0.0a1 and
> MySQLdb module release: 0.2.2 .
>
> Could someone please let me know as I don't want to have to type
> the extra
> bits on all my SQL statements from here on in if I don't need to
> (I am the
> world's worst and laziest typist). If it is the case that it's a
> necessary
> evil, then I want to put a HowTo or Tip up on zope.org because it
> took me a
> while to figure out what I was doing wrong, and if I can save
> someone else
> that same wasted time then I would like to. However I wanted to get my
> facts straight (via all you experts) first.
>
> Thanks for any help...
>
>   - Michael
> ~~~
> Michael Blewett
> Computer Support Mgr - Biological Sciences
> Monash University (Clayton Campus)
> Victoria Australia 3168
>
> " Can I trade this job for what's behind door #2? "
>
>
> ___
> Zope maillist  -  [EMAIL PROTECTED]
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>
>


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] MySQL Select Statements

2000-06-29 Thread Curtis Maloney

On Fri, 30 Jun 2000, Michael Blewett wrote:
> Hi Everyone,
> Just need someone to put me straight here. When I use Select statements in
> an SQL Method I cannot simply :
>
> Select Column1, Column2 etc
> from TableA.
>
Depending on  the column names, yes you can.  I just tested it not, and it 
works fine.  If the column names are not valid zope/python names, you will 
run into problems.

> Instead I must use the AS statement ie
>
> Select Column1 AS Column1, Column2 AS Column2
> from TableA.
>
> Is this just an oddity with the MySQLDA/Db adapters or am I overlooking
> something blatantly obvious here? All the examples on zope.org don't have
> the extra "AS Column1" additions on them and I was wondering if this is a
> Zope/mySQL-unique thing.

Can you try to construct the simplest example of a query that doesn't work?

>
> I'm using Zope (2.1.6) with MySQL (3.22.32) with Zope MySQL Database
> Adapter (ZMySQLDA) 2.0.0a1 and
> MySQLdb module release: 0.2.2 .

Hmm.. I am using the same, except for ZMySQLda 1.1.3, and MySQLdb 0.1.2.  So, 
perhaps it's new in ZMySQLda 2.0.

>
> Could someone please let me know as I don't want to have to type the extra
> bits on all my SQL statements from here on in if I don't need to (I am the
> world's worst and laziest typist). If it is the case that it's a necessary

What, you've never heard of cut'n'paste? (o8

> evil, then I want to put a HowTo or Tip up on zope.org because it took me a
> while to figure out what I was doing wrong, and if I can save someone else
> that same wasted time then I would like to. However I wanted to get my
> facts straight (via all you experts) first.

A wise move, and a wonderful gesture.

>
> Thanks for any help...
>
>   - Michael

Have a better one,
Curtis Maloney



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )