Mailing List Archive

Setting max_rows and cache_time for SQLMethods on the file system
I am using Zope 2.8.4/Plone 2.1.1/ZPsycopgDA 1.20 on a Debian box.

I have a few SQLMethods which has been put on the filesystem using FSDump 0.9
and are read by a Plone site with a DirectoryView.

A typical one is the following:

$ cat distinct_client_names.zsql
<dtml-comment>
title:
arguments:
connection_id:rcare_connection
max_rows_:1000
max_cache_:1000
cache_time_:86400
class_name_:
class_file_:
</dtml-comment>
select distinct client from rhp_clientcode

I have discovered that the values in the dtml-comment are not honored:
so if I change max_rows_ to a different value nothing happens.
Zope always retrieve up to 1000 rows, which is the default value
fixed somewhere: grepping a bit I discovered that there is a
``max_rows = 1000`` statement in Shared/DC/ZRDB/DA.py, but changing this
had no effect, so it must be set somewhere else.

If I define a new SQLMethod in the ZMI (i.e. not in the file system)
and I set the max_rows limit there, everything works fine.

So, how do I change the max_rows and cach_time limits for the SQLMethods
on the file system?


Michele Simionato
_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db
Re: Setting max_rows and cache_time for SQLMethods on the file system [ In reply to ]
--On 13. Januar 2006 11:12:22 +0100 Michele Simionato
<michele.simionato@gmail.com> wrote:
> I have discovered that the values in the dtml-comment are not honored:
> so if I change max_rows_ to a different value nothing happens.
> Zope always retrieve up to 1000 rows, which is the default value
> fixed somewhere: grepping a bit I discovered that there is a
> ``max_rows = 1000`` statement in Shared/DC/ZRDB/DA.py, but changing this
> had no effect, so it must be set somewhere else.
>

Because it must be "max_rows: 1000".

-aj
Re: Setting max_rows and cache_time for SQLMethods on the file system [ In reply to ]
On 1/13/06, Andreas Jung <lists@andreas-jung.com> wrote:
>
> Because it must be "max_rows: 1000".
>
> -aj


You mean without the tralining underscore in the dtml-comment?
So I should change

<dtml-comment>
title:
arguments:
connection_id:rcare_connection
max_rows:1000
max_cache:1000
cache_time:86400
class_name:
class_file:
</dtml-comment>

instead of
<dtml-comment>
title:
arguments:
connection_id:rcare_connection
max_rows_:1000
max_cache_:1000
cache_time_:86400
class_name_:
class_file_:
</dtml-comment>

? The dtml-comments where generated by FSDump so I assumed they were
correct.

Michele Simionato
_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db
Re: Setting max_rows and cache_time for SQLMethods on the file system [ In reply to ]
For the record, removing the trailing underscore worked. Damn FSDump!
Thanks for the help.

Michele Simionato
_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db