Mike | 16 May 17:57
Picon

Using SQLAlchemy with Plone/Zope


Hi,

We are using SQLAlchemy 4.X in Zope using SQLAlchemyDA, found here:

http://opensource.zopyx.com/projects/SQLAlchemyDA

This uses SA 0.4.0. We are connecting to MS SQL 2000. While this works
in Zope for normal SQL commands, if we try to execute a stored
procedure, we get the following traceback:

[Traceback (most recent call last):
  File "sqltest.py", line 14, in ?
    print cur.fetchall()
  File "/opt/Plone-2.5/Python-2.4.3/lib/python2.4/site-packages/
SQLAlchemy-0.4.0-py2.4.egg/sqlalchemy/engine/base.py", line 1231, in
__repr__
    return repr(tuple(self))
  File "/opt/Plone-2.5/Python-2.4.3/lib/python2.4/site-packages/
SQLAlchemy-0.4.0-py2.4.egg/sqlalchemy/engine/base.py", line 1223, in
__iter__
    yield self.__parent._get_col(self.__row, i)
  File "/opt/Plone-2.5/Python-2.4.3/lib/python2.4/site-packages/
SQLAlchemy-0.4.0-py2.4.egg/sqlalchemy/engine/base.py", line 1468, in
_get_col
    rec = self._key_cache[key]
AttributeError: 'ResultProxy' object has no attribute '_key_cache'

I'm not sure how to go about troubleshooting this. Would upgrading it
to SQLAlchemy 0.4.5 fix it? Any hints would be appreciated.
(Continue reading)

Andreas Jung | 16 May 18:06
Favicon

Re: Using SQLAlchemy with Plone/Zope


--On 16. Mai 2008 08:58:38 -0700 Mike <kyosohma <at> gmail.com> wrote:

>
> Hi,
>
> We are using SQLAlchemy 4.X in Zope using SQLAlchemyDA, found here:
>
> http://opensource.zopyx.com/projects/SQLAlchemyDA
>
> This uses SA 0.4.0. We are connecting to MS SQL 2000. While this works
> in Zope for normal SQL commands, if we try to execute a stored
> procedure, we get the following traceback:
>
>
> [Traceback (most recent call last):
>   File "sqltest.py", line 14, in ?
>     print cur.fetchall()
>   File "/opt/Plone-2.5/Python-2.4.3/lib/python2.4/site-packages/
> SQLAlchemy-0.4.0-py2.4.egg/sqlalchemy/engine/base.py", line 1231, in
> __repr__
>     return repr(tuple(self))
>   File "/opt/Plone-2.5/Python-2.4.3/lib/python2.4/site-packages/
> SQLAlchemy-0.4.0-py2.4.egg/sqlalchemy/engine/base.py", line 1223, in
> __iter__
>     yield self.__parent._get_col(self.__row, i)
>   File "/opt/Plone-2.5/Python-2.4.3/lib/python2.4/site-packages/
> SQLAlchemy-0.4.0-py2.4.egg/sqlalchemy/engine/base.py", line 1468, in
> _get_col
>     rec = self._key_cache[key]
(Continue reading)

Mike | 16 May 19:33
Picon

Re: Using SQLAlchemy with Plone/Zope


On May 16, 11:06 am, Andreas Jung <li...@zopyx.com> wrote:
> --On 16. Mai 2008 08:58:38 -0700 Mike <kyoso...@gmail.com> wrote:
>
>
>
>
>
> > Hi,
>
> > We are using SQLAlchemy 4.X in Zope using SQLAlchemyDA, found here:
>
> >http://opensource.zopyx.com/projects/SQLAlchemyDA
>
> > This uses SA 0.4.0. We are connecting to MS SQL 2000. While this works
> > in Zope for normal SQL commands, if we try to execute a stored
> > procedure, we get the following traceback:
>
> > [Traceback (most recent call last):
> >   File "sqltest.py", line 14, in ?
> >     print cur.fetchall()
> >   File "/opt/Plone-2.5/Python-2.4.3/lib/python2.4/site-packages/
> > SQLAlchemy-0.4.0-py2.4.egg/sqlalchemy/engine/base.py", line 1231, in
> > __repr__
> >     return repr(tuple(self))
> >   File "/opt/Plone-2.5/Python-2.4.3/lib/python2.4/site-packages/
> > SQLAlchemy-0.4.0-py2.4.egg/sqlalchemy/engine/base.py", line 1223, in
> > __iter__
> >     yield self.__parent._get_col(self.__row, i)
> >   File "/opt/Plone-2.5/Python-2.4.3/lib/python2.4/site-packages/
(Continue reading)

Andreas Jung | 16 May 19:34
Favicon

Re: Using SQLAlchemy with Plone/Zope


--On 16. Mai 2008 18:06:46 +0200 Andreas Jung <lists <at> zopyx.com> wrote:

>
>
> --On 16. Mai 2008 08:58:38 -0700 Mike <kyosohma <at> gmail.com> wrote:
>
>>
>> Hi,
>>
>> We are using SQLAlchemy 4.X in Zope using SQLAlchemyDA, found here:
>>
>> http://opensource.zopyx.com/projects/SQLAlchemyDA
>>
>> This uses SA 0.4.0. We are connecting to MS SQL 2000. While this works
>> in Zope for normal SQL commands, if we try to execute a stored
>> procedure, we get the following traceback:
>>
>>
>> [Traceback (most recent call last):
>>   File "sqltest.py", line 14, in ?
>>     print cur.fetchall()
>>   File "/opt/Plone-2.5/Python-2.4.3/lib/python2.4/site-packages/
>> SQLAlchemy-0.4.0-py2.4.egg/sqlalchemy/engine/base.py", line 1231, in
>> __repr__
>>     return repr(tuple(self))
>>   File "/opt/Plone-2.5/Python-2.4.3/lib/python2.4/site-packages/
>> SQLAlchemy-0.4.0-py2.4.egg/sqlalchemy/engine/base.py", line 1223, in
>> __iter__
>>     yield self.__parent._get_col(self.__row, i)
(Continue reading)

Michael Bayer | 16 May 19:39

Re: Using SQLAlchemy with Plone/Zope


On May 16, 2008, at 11:58 AM, Mike wrote:

>
>
> I'm not sure how to go about troubleshooting this. Would upgrading it
> to SQLAlchemy 0.4.5 fix it? Any hints would be appreciated.
>

Hi Mike -

yeah, i see your stacktrace is from 0.4.0 and i have a vague  
recollection of some ResultProxy bug of that nature back then, so an  
upgrade should fix it (current version is 0.4.6).

- mike

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To post to this group, send email to sqlalchemy <at> googlegroups.com
To unsubscribe from this group, send email to sqlalchemy-unsubscribe <at> googlegroups.com
For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---


Gmane