[Zope] ZSQLMethod Cache(unusual behavior)

Raúl Pérez rperez@hola.com
Tue, 30 Oct 2001 18:55:57 +0100


This is a multi-part message in MIME format.

------=_NextPart_000_00C5_01C16174.82A16380
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi all, I am a newbie and I have a question,=20

I have a countries table with 'country_code' and 'name' fields, the =
table has=20
211 records and
the database is postgres and connection is made with product Z Psycopg =
(also I
have checked it with PoPy and the result is the same one I explain =
later).=20

I have declared a ZSQLMethod(getCountriesZSQL) with a simple query:=20
SELECT country_code,name FROM countries. At Advanced Tab's ZSQLMethod I =
have=20
managed the following parameters to cache the query:

Maximum rows to retrieve: 300=20
Maximum results to breaks: 300=20
Maximum Time (sec) to breaks: 5000=20

I have created a DMTL Method to show a combo-select of countries:=20

<SELECT name=3D"comboCountries">
<dtml-in getCountriesZSQL>
<OPTION VALUE=3D'<dtml-var country_code null=3D"">'>
<dtml-var name null=3D"">
</dtml-in>
</SELECT>=20

This is my question:
When I delete a record of countries table, the table changes and=20
I think that the combo-select shouldn=B4t change because is cached;=20
but, in fact, the combo-select changes soon, over he fifth or sixth page =

refresh. The result changes showing 210 and 211 records randomly...=20

What is the reason of this behavior?
Does anyone know what is the solution?

Regards,
ZRaul.
Z8-)




------=_NextPart_000_00C5_01C16174.82A16380
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4134.600" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi all, I am a newbie and I have a =
question,=20
</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I have a countries table with =
'country_code' and=20
'name' fields, the table has <BR>211 records and<BR>the database is =
postgres and=20
connection is made with product Z Psycopg (also I<BR>have checked it =
with PoPy=20
and the result is the same one I explain later). </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I have declared a =
ZSQLMethod(getCountriesZSQL) with=20
a simple query: <BR>SELECT country_code,name FROM countries. At Advanced =
Tab's=20
ZSQLMethod I have <BR>managed the following parameters to cache the=20
query:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Maximum rows to retrieve: 300 =
<BR>Maximum results=20
to breaks: 300 <BR>Maximum Time (sec) to breaks: 5000 </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I have created a DMTL Method to show a =
combo-select=20
of countries: </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&lt;SELECT =
name=3D"comboCountries"&gt;<BR>&lt;dtml-in=20
getCountriesZSQL&gt;<BR>&lt;OPTION VALUE=3D'&lt;dtml-var country_code=20
null=3D""&gt;'&gt;<BR>&lt;dtml-var name=20
null=3D""&gt;<BR>&lt;/dtml-in&gt;<BR>&lt;/SELECT&gt; </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>This is my question:<BR>When I delete a =
record of=20
countries table, the table changes and <BR>I think that the combo-select =

shouldn=B4t change because is cached; <BR>but, in fact, the combo-select =
changes=20
soon, over he fifth or sixth page <BR>refresh. The result changes =
showing 210=20
and 211 records randomly... </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>What is the reason of this =
behavior?<BR>Does anyone=20
know what is the solution?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Regards,<BR>ZRaul.<BR>Z8-)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_00C5_01C16174.82A16380--