You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Lars Huttar <la...@sil.org> on 2004/05/06 23:55:30 UTC

esql xsp page caching?

Hi all,

I have the following simple XSP page:

<xsp:page language="java"
    xmlns:xsp="http://apache.org/xsp"
    xmlns:xsp-request="http://apache.org/xsp/request/2.0"
    xmlns:esql="http://apache.org/cocoon/SQL/v2"
    xmlns:sil="http://www.sil.org/namespace/cocoon-sql-logicsheet">

  <footer>
    <code><xsp-request:get-parameter name="code"/></code>
   
    <sil:query connection="ethnolog">
            SELECT to_char(sysdate, 'Dy dd-Mon-yyyy') AS Current_Date,
                         to_char(sysdate, 'HH:MM AM') AS Current_Time
             FROM Dual
    </sil:query>

  </footer>
</xsp:page>


It works as expected, except that once you start running it,
it continues to return the same answer for the Current_Time,
even 1/2 hour later!
Anybody know if this is an XSP/ESQL caching issue, or perhaps
an Oracle db issue?

I'm confused...

If needed, here's the logicsheet template that expands the <sil:query>
element:


  
  <xsl:template match="sil:query">
    <!-- get 'connection' parameter -->
    <xsl:variable name="connection">
      <xsl:call-template name="get-param">
        <xsl:with-param name="name" select="'connection'" />
      </xsl:call-template>
    </xsl:variable>
    <!-- get 'row-element' parameter -->
    <xsl:variable name="row-element">
      <xsl:call-template name="get-param">
        <xsl:with-param name="name" select="'row-element'" />
      </xsl:call-template>
    </xsl:variable>

    <xsl:variable name="execute-query">
      <esql:execute-query>
        <esql:query>
          <xsl:apply-templates select="node()|@*" />
        </esql:query>
        <esql:results>
          <esql:row-results>
            <xsl:choose>
              <xsl:when test="string($row-element)">
                <xsl:element name="{$row-element}">
                  <esql:get-columns />
                </xsl:element>
              </xsl:when>
              <xsl:otherwise>
                <esql:get-columns />
              </xsl:otherwise>
            </xsl:choose>
          </esql:row-results>
        </esql:results>
      </esql:execute-query>
    </xsl:variable>
    
    <xsl:choose>
      <xsl:when test="string($connection)">
        <esql:connection>
          <esql:pool><xsl:value-of select="$connection" /></esql:pool>
          <xsl:copy-of select="$execute-query" />
        </esql:connection>
      </xsl:when>
      <xsl:otherwise>
        <xsl:copy-of select="$execute-query" />
      </xsl:otherwise>
    </xsl:choose>

  </xsl:template>


Thanks,
Lars


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: esql xsp page caching?

Posted by Lars Huttar <la...@sil.org>.
Hi all,
I didn't find out why I was getting the same date/time value
over and over, but I found a better way to do what I needed.
Instead of calling an XSP that did a SELECT statement,
I just used the DateInputModule in the sitemap.

Regards,
Lars

> -----Original Message-----
> From: Yves Vindevogel [mailto:yves.vindevogel@implements.be]
> Sent: Friday, May 07, 2004 4:06 AM
> To: users@cocoon.apache.org
> Subject: Re: esql xsp page caching?
> 
> 
> Hi Lars,
> 
> I bumped into the same problem too, but, I found out that it was not 
> Cocoon who was caching.
> My client had a Mickeysoft Isa Server as proxy and even with the meta 
> tags like "pragma no cache", Isa kept caching the URL.
> I found out that it was based on the URL, so when I gave another URL 
> with a dummy parameter in it, it did not cache.
> What I eventually did, was adding the session-id to the URL, so at 
> least between two sessions, the problem was fixed.
> 
> On 06 May 2004, at 23:55, Lars Huttar wrote:
> 
> > Hi all,
> >
> > I have the following simple XSP page:
> >
> > <xsp:page language="java"
> >     xmlns:xsp="http://apache.org/xsp"
> >     xmlns:xsp-request="http://apache.org/xsp/request/2.0"
> >     xmlns:esql="http://apache.org/cocoon/SQL/v2"
> >     xmlns:sil="http://www.sil.org/namespace/cocoon-sql-logicsheet">
> >
> >   <footer>
> >     <code><xsp-request:get-parameter name="code"/></code>
> >
> >     <sil:query connection="ethnolog">
> >             SELECT to_char(sysdate, 'Dy dd-Mon-yyyy') AS 
> Current_Date,
> >                          to_char(sysdate, 'HH:MM AM') AS 
> Current_Time
> >              FROM Dual
> >     </sil:query>
> >
> >   </footer>
> > </xsp:page>
> >
> >
> > It works as expected, except that once you start running it,
> > it continues to return the same answer for the Current_Time,
> > even 1/2 hour later!
> > Anybody know if this is an XSP/ESQL caching issue, or perhaps
> > an Oracle db issue?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: esql xsp page caching?

Posted by Yves Vindevogel <yv...@implements.be>.
Hi Lars,

I bumped into the same problem too, but, I found out that it was not 
Cocoon who was caching.
My client had a Mickeysoft Isa Server as proxy and even with the meta 
tags like "pragma no cache", Isa kept caching the URL.
I found out that it was based on the URL, so when I gave another URL 
with a dummy parameter in it, it did not cache.
What I eventually did, was adding the session-id to the URL, so at 
least between two sessions, the problem was fixed.

On 06 May 2004, at 23:55, Lars Huttar wrote:

> Hi all,
>
> I have the following simple XSP page:
>
> <xsp:page language="java"
>     xmlns:xsp="http://apache.org/xsp"
>     xmlns:xsp-request="http://apache.org/xsp/request/2.0"
>     xmlns:esql="http://apache.org/cocoon/SQL/v2"
>     xmlns:sil="http://www.sil.org/namespace/cocoon-sql-logicsheet">
>
>   <footer>
>     <code><xsp-request:get-parameter name="code"/></code>
>
>     <sil:query connection="ethnolog">
>             SELECT to_char(sysdate, 'Dy dd-Mon-yyyy') AS Current_Date,
>                          to_char(sysdate, 'HH:MM AM') AS Current_Time
>              FROM Dual
>     </sil:query>
>
>   </footer>
> </xsp:page>
>
>
> It works as expected, except that once you start running it,
> it continues to return the same answer for the Current_Time,
> even 1/2 hour later!
> Anybody know if this is an XSP/ESQL caching issue, or perhaps
> an Oracle db issue?
>
> I'm confused...
>
> If needed, here's the logicsheet template that expands the <sil:query>
> element:
>
>
>
>   <xsl:template match="sil:query">
>     <!-- get 'connection' parameter -->
>     <xsl:variable name="connection">
>       <xsl:call-template name="get-param">
>         <xsl:with-param name="name" select="'connection'" />
>       </xsl:call-template>
>     </xsl:variable>
>     <!-- get 'row-element' parameter -->
>     <xsl:variable name="row-element">
>       <xsl:call-template name="get-param">
>         <xsl:with-param name="name" select="'row-element'" />
>       </xsl:call-template>
>     </xsl:variable>
>
>     <xsl:variable name="execute-query">
>       <esql:execute-query>
>         <esql:query>
>           <xsl:apply-templates select="node()|@*" />
>         </esql:query>
>         <esql:results>
>           <esql:row-results>
>             <xsl:choose>
>               <xsl:when test="string($row-element)">
>                 <xsl:element name="{$row-element}">
>                   <esql:get-columns />
>                 </xsl:element>
>               </xsl:when>
>               <xsl:otherwise>
>                 <esql:get-columns />
>               </xsl:otherwise>
>             </xsl:choose>
>           </esql:row-results>
>         </esql:results>
>       </esql:execute-query>
>     </xsl:variable>
>
>     <xsl:choose>
>       <xsl:when test="string($connection)">
>         <esql:connection>
>           <esql:pool><xsl:value-of select="$connection" /></esql:pool>
>           <xsl:copy-of select="$execute-query" />
>         </esql:connection>
>       </xsl:when>
>       <xsl:otherwise>
>         <xsl:copy-of select="$execute-query" />
>       </xsl:otherwise>
>     </xsl:choose>
>
>   </xsl:template>
>
>
> Thanks,
> Lars
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org