<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br class="Apple-interchange-newline"> </div><br><div><div>On 31.08.2007, at 14:57, Christopher Armstrong wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; ">On 8/31/07,<span class="Apple-converted-space"> </span><b class="gmail_sendername">Bernd Dorn</b><span class="Apple-converted-space"> </span><<a href="mailto:bernd.dorn@lovelysystems.com">bernd.dorn@lovelysystems.com</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">we use storm with zope (version .10) and discovered that the<br>store._cache attribute never caches, because the weakrefs are gone<br>immediatly</blockquote><div><br>Your conclusion is incorrect. The cache does work as intended; perhaps it is not what you want, though. The cache is there to prevent loading objects from the database when they are already in memory, and to avoid creating duplicate objects when the same row is loaded twice (if a row is retrieved a second time within the same transaction, the original object is updated instead of creating a new one).<span class="Apple-converted-space"> </span></div></div></span></blockquote></div><br><div>hm dunno if i understood you right ... the point is that i don't want to retrieve the row again</div><div><br class="webkit-block-placeholder"></div><div>if i do a store.get(Klass, id) and i don't reference the object anymore in my code it is gone immediatly</div><div><br class="webkit-block-placeholder"></div><div>then i do the same get one more time, storm does a select again</div><div><br class="webkit-block-placeholder"></div><div>i don't understand the use-case for this kind of caching - if i have to maintain a reference to the object anyways, why do a need the cache?</div><div><br class="webkit-block-placeholder"></div><div>for example:</div><div><br class="webkit-block-placeholder"></div><div>we have a request in zope and i want to get a specific storm object i have to get it via storm.get(...)</div><div><br class="webkit-block-placeholder"></div><div>in the same request/transaction i do a second get, from another component of my view and i also have to use storm.get(..) for it </div><div><br class="webkit-block-placeholder"></div><div>so we end up having up to 30 ident selects to the database for a single page</div><div><br class="webkit-block-placeholder"></div><div>i am wondering how this is handled in launchpad</div><div><br class="webkit-block-placeholder"></div><div> </div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div></body></html>