J. Wolfgang Kaltz wrote:

Eric Caron schrieb:

Hello,

Our application is using some XSP files to generate some dynamic content with ESQL. Despite having all parts of the sitemap set to noncaching and reading in Cocoon that XSP is not cached by default, the XSP file seems to be cached. My question is: how could XSP be caching and where/how do I stop it?


AFAIK, XSP are not cached in any sense, but translated to Java classes which are then compiled on the fly. This happens upon the first request for the XSP. If you change the XSP file Cocoon detects this and recreates and recompiles the Java class.

If the data isn't cached for XSP (which I too initially assumed), then where/what is caching it.



Proof that XSP is caching:
1) Simple sitemap that has pipeline's type as noncaching.
2) Simple pipleline that calls XSP as generator and serializes it as XML. 3) Generate page, change SQL, reload page (contents won't reflect change to SQL)
4) Touch XSP file, reload page, new SQL changes will appear.


I don't understand - where are your SQL statements ? In the XSP ? If so then changing the SQL also changes the XSP file !?

SQL statements are in the XSP file. Here is an excerpt of the code from my XSP file
***
 <esql:execute-query>
   <esql:query>SELECT zipcodes.latitude, zipcodes.longitude
FROM squeegee.zipcodes AS zipcodes WHERE zipcodes.zip = 10001 LIMIT 1</esql:query>
   <esql:results>
       <esql:row-results>
         <xsp:logic>
           clientLatitude = <esql:get-double column="latitude"/>;
           clientLongitude = <esql:get-double column="latitude"/>;
         </xsp:logic>
         <client>
           <zip><xsp:expr>clientZip</xsp:expr></zip>
           <latitude><xsp:expr>clientLatitude</xsp:expr></latitude>
           <longitude><xsp:expr>clientLongitude</xsp:expr></longitude>
         </client>
       </esql:row-results>
   </esql:results>
   <esql:no-results>
<p>Sorry, no results for <xsp-request:get-parament name="clientZip"/>!</p>
   </esql:no-results>
 </esql:execute-query>
***
The page then shows the latitude and longitude of 10001 (New York City's zip code). If I go into the database, and change the latitude and longitude for 10001, then refresh the page, it doesn't show the new changes.


BTW for SQL calls you can also use Cocoon's SQL transformer, to avoid writing an XSP yourself.

The queries that I'm doing need to be done in a flowscript or XSP, and I opted for using ESQL over SQL because it let me specify the connection information (driver, url, username, password) within the code.

If it would helpful for me to attach the XSP file, let me know. It has been easy for me to recreate the problem. I'm wondering if anyone has successfully used SQL or ESQL within an XSP file.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to