Thanks for your help Christophe. I found a getRoot in zope.traversal.api but it requires the context of a child a object that is Persistent. Thus, I couldn&#39;t use the context in my none persistent code to find the parent Persistent root. What I ended up doing was hooking into IDatabaseOpenedWithRootEvent and registering a utility with my connection info. It seems strange to have to do it this way, but it works. <br>
<br>It&#39;d be nice for there to already be a utility registered for me in the GlobalSiteManager that has the Persistent connection info rather then having to register it myself.<br><br>- Jim<br><br><div class="gmail_quote">
On Thu, Jul 1, 2010 at 6:49 AM, Christophe Combelles <span dir="ltr">&lt;<a href="mailto:ccomb@free.fr">ccomb@free.fr</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
rootFolder is a class or factory to create a rootfolder, but this is just an applicative root folder with a specific interface, just a convention. The zodb root object is a different object which is always present when you open an empty zodb, and that you&#39;ll be able to access with IDatabaseOpenedWithRoot event.<br>
<br>If you want to retrieve the root object or any possible rootFolder, you can use some hooks such as getSite or getRoot, I don&#39;t remember where they are<br><br>Christophe<br><br>----- Reply message -----<br>De : &quot;Jim Pharis&quot; &lt;<a href="mailto:binbrain@gmail.com" target="_blank">binbrain@gmail.com</a>&gt;<br>
Date : mer., juin 30, 2010 23:05<br>Objet : [BlueBream] can&#39;t persist<br>Pour : &quot;Christophe Combelles&quot; &lt;<a href="mailto:ccomb@free.fr" target="_blank">ccomb@free.fr</a>&gt;<br>Cc : &lt;<a href="mailto:bluebream@zope.org" target="_blank">bluebream@zope.org</a>&gt;<div>
<div></div><div class="h5"><br><br><br>So I&#39;m mistaken about the purpose of the rootFolder method then. However, I<br>can&#39;t really use the IDataOpenedWithRootEvent cleanly because I don&#39;t want<br>the root obj when the connection is opened, I want it later. Therefore,<br>
getting at the root obj still isn&#39;t real obvious to me in this situation.<br><br>On Wed, Jun 30, 2010 at 4:06 PM, Christophe Combelles &lt;<a href="mailto:ccomb@free.fr" target="_blank">ccomb@free.fr</a>&gt; wrote:<br>
<br>&gt; Le 30/06/2010 21:47, Jim Pharis a écrit :<br>&gt; &gt; No, I don&#39;t see the changes. Maybe I should be more specific about what<br>&gt; &gt; I&#39;m doing.<br>&gt; &gt;<br>&gt; &gt; I have an AdminUtility registered with the below method that I call from<br>
&gt; &gt; a view. If I inspect the root object after that method exists newsite<br>&gt; &gt; isn&#39;t in there.<br>&gt; &gt;<br>&gt; &gt; from zope.site.folder import rootFolder<br>&gt; &gt; def install(self)<br>&gt; &gt;          newsite = NewSite()<br>
&gt; &gt;          newsite.setSiteManager(LocalSiteManager(newsite))<br>&gt; &gt;          root = rootFolder()<br>&gt; &gt;          import pdb; pdb.set_trace()<br>&gt; &gt;          root[&#39;newsite&#39;] = newsite<br>&gt; &gt;          root._p_changed = True<br>
&gt; &gt;          transaction.commit()<br>&gt;<br>&gt;<br>&gt; You&#39;re creating a root object in a local variable, and this variable is<br>&gt; destroyed at the end of the function. You should retrieve the root instead<br>
&gt; of<br>&gt; creating it, since an empty ZODB always has a root object.<br>&gt;<br>&gt;<br>&gt; <a href="http://bluebream.zope.org/doc/1.0/faq.html#how-do-i-automatically-create-some-needed-object-at-application-startup" target="_blank">http://bluebream.zope.org/doc/1.0/faq.html#how-do-i-automatically-create-some-needed-object-at-application-startup</a><br>
&gt;<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; On Wed, Jun 30, 2010 at 3:11 PM, Christophe Combelles &lt;<a href="mailto:ccomb@free.fr" target="_blank">ccomb@free.fr</a><br>&gt; &gt; &lt;mailto:<a href="mailto:ccomb@free.fr" target="_blank">ccomb@free.fr</a>&gt;&gt; wrote:<br>
&gt; &gt;<br>&gt; &gt;     Le 30/06/2010 20:31, Jim Pharis a écrit :<br>&gt; &gt;      &gt; I&#39;m trying out BlueBream 1.0b2 and I&#39;m running into a problem with<br>&gt; &gt;      &gt; Persistent objects. The installation is pretty out of the box at<br>
&gt; this<br>&gt; &gt;      &gt; point. When I use .\bin\paster shell debug.ini I seem to be able<br>&gt; to<br>&gt; &gt;      &gt; create Persistent objects and transaction.commit and changed<br>&gt; &gt;     objects are<br>
&gt; &gt;      &gt; properly committed. However, when I start using either<br>&gt; .\bin\paster<br>&gt; &gt;      &gt; serve debug.ini or .\bin\paster serve deploy.ini, no matter what<br>&gt; &gt;     I do to<br>&gt; &gt;      &gt; Persistent objects transaction.commit() returns None. I noticed<br>
&gt; that<br>&gt; &gt;      &gt; even if I directly set obj._p_changed=1 it doesn&#39;t work, and if I<br>&gt; &gt;     look<br>&gt; &gt;      &gt; at _p_changed right away, I see its been reverted back to False.<br>&gt; &gt;     What am<br>
&gt; &gt;      &gt; I doing wrong here?<br>&gt; &gt;<br>&gt; &gt;     Hi!<br>&gt; &gt;<br>&gt; &gt;     transaction.commit() is not supposed to return anything, don&#39;t you<br>&gt; &gt;     see the<br>&gt; &gt;     changes in your application after ending the debug session and<br>
&gt; &gt;     returning to the<br>&gt; &gt;     paster serve ?<br>&gt; &gt;<br>&gt; &gt;     Christophe<br>&gt; &gt;<br>&gt; &gt;      &gt;<br>&gt; &gt;      &gt; TIA,<br>&gt; &gt;      &gt;<br>&gt; &gt;      &gt; - Jim<br>
&gt; &gt;      &gt;<br>&gt; &gt;      &gt;<br>&gt; &gt;      &gt;<br>&gt; &gt;      &gt; _______________________________________________<br>&gt; &gt;      &gt; bluebream mailing list<br>&gt; &gt;      &gt; <a href="mailto:bluebream@zope.org" target="_blank">bluebream@zope.org</a> &lt;mailto:<a href="mailto:bluebream@zope.org" target="_blank">bluebream@zope.org</a>&gt;<br>
&gt; &gt;      &gt; <a href="https://mail.zope.org/mailman/listinfo/bluebream" target="_blank">https://mail.zope.org/mailman/listinfo/bluebream</a><br>&gt; &gt;<br>&gt; &gt;     _______________________________________________<br>
&gt; &gt;     bluebream mailing list<br>&gt; &gt;     <a href="mailto:bluebream@zope.org" target="_blank">bluebream@zope.org</a> &lt;mailto:<a href="mailto:bluebream@zope.org" target="_blank">bluebream@zope.org</a>&gt;<br>
&gt; &gt;     <a href="https://mail.zope.org/mailman/listinfo/bluebream" target="_blank">https://mail.zope.org/mailman/listinfo/bluebream</a><br>&gt; &gt;<br>&gt; &gt;<br>&gt;<br>&gt; _______________________________________________<br>
&gt; bluebream mailing list<br>&gt; <a href="mailto:bluebream@zope.org" target="_blank">bluebream@zope.org</a><br>&gt; <a href="https://mail.zope.org/mailman/listinfo/bluebream" target="_blank">https://mail.zope.org/mailman/listinfo/bluebream</a><br>
&gt;<br><br><br></div></div><br>_______________________________________________<br>
bluebream mailing list<br>
<a href="mailto:bluebream@zope.org">bluebream@zope.org</a><br>
<a href="https://mail.zope.org/mailman/listinfo/bluebream" target="_blank">https://mail.zope.org/mailman/listinfo/bluebream</a><br>
<br></blockquote></div><br>