David Whittaker
unread,Apr 22, 2011, 1:31:47 PM4/22/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to liftweb
I have 2 snippets, one which transforms my page header and another which executes on HTML inside the header and output a menu. Both of these snippets transform HTML that needs to be re-rendered on login, so I decided to memoize them with SHtml.memoize. Unfortunately, I'm finding that the template for the outter memo is getting overwritten by the template from the inner memo. I looked at the code and I see that the captured template is stored in a RequestVar, and that the salt used is based on the stack trace when the memo is created. I would expect that would be fine, each memoize call happens in a different method (although they are in the same object) which I would think would lead to a different stack, but regardless of what I expect I can see that the second memoize is somehow clobbering the first. In the meantime I'm going to switch them to SHtml.idMemoizeTransform which doesn't use a RequestVar, but I'm interested in figuring out what's going on here and if it can be fixed.