cache tag+exception=inconsistent behavior
Wally Bowles <[email protected]>
| Newsgroups | gmane.comp.java.open-symphony.os-cache |
|---|---|
| Message-ID | <[email protected]> |
My tests show inconsistent results using the <cache> tag when an exception is thrown during the rendering process (see below) base on attributes provided. #1. When an exception occurs rendering content X1 below, using the time= attribute, results in an exception stack trace thats displayed. <cache:cache key=mykey time="60" > . . . . render jsp content X1 (exception occurs here) </cache:cache> #2. However, when an exception occurs rendering content X2 below, using the refresh= attribute, results in a failover to occur and display the old X2 cached content. <cache:cache key=mykey refresh="<%=needRefresh%>" > . . . . render jsp content X2 (exception occurs here) </cache:cache> #3 Why the difference in behavior between #1 and #2 on the <cache> tag? If an exception is thrown, what is supposed to happen? (#1) Blows up and gives you a stack trace page. (#2) Reverts back and fails over to the old cached content. The <usecached> tag documentation clearly indicates how it behaves, and works consistently. #4. Wish List, to have a consistent behavior you can count on. Otherwise create a new attribute in the <cache> tag to indicate to failover or not. New attribute à failover: failover=false yields an exception stack when exception occurs during rendering. (for debugging) failover=true [default] fails over to old cached content if it exists, else display a message cached content is missing (true to be used in production with event listeners to report this) Please help shed some light on the difference. Wally __________________________________ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/ ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/