Concerning zeo, I do not use it in the developpement plateforme, but there&#39;s one in the test and production platformes, so maybe I will face the problem during the test phase. <br>I do not understand : session objects should be unique for each browser, so why are there conflict errors on them ????? 
<br><br>&gt;If ZEO cannot reach your product (import it), it cannot run any<br>&gt;conflict resolution. Make sure that the ZEO server setup has access to<br>&gt;those Products that do conflict resolution.<br><br>The product that does conflict resolution is the Transient object (I think it is the session object) , which is 
Zope2.9.0/lib/python/Products/Transcience. I think that zeo should see it.<br><br><br><div><span class="gmail_quote">2007/1/25, yacine chaouche &lt;<a href="mailto:yacinechaouche@gmail.com">yacinechaouche@gmail.com</a>&gt;:
</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><span class="q">&gt;Is _p_resolveConflict method of Inceraser executed at all?<br>&gt;I wonder if traceback you see in console is from the
<br>&gt;code you added:<br>&gt;traceback.print_exc(file=stdin)<br>&gt;<br>&gt;or it is always shown when there is a conflict error.
<br><br></span><span class="q">&lt;code&gt;<br>&nbsp;&nbsp;&nbsp; def _p_resolveConflict(self, old, state1, state2):<br></span>&nbsp;&nbsp;&nbsp; print &quot;called the _p_resolveConflict of the Increaser object&quot;,self<span class="q"><br>&nbsp;&nbsp;&nbsp; try:
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; number = max(old,state1,state2)<br>
&nbsp;&nbsp;&nbsp; except Exception,msg:<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; import traceback<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; traceback.print_exc(file=sys.stdin)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return max(old, state1, state2)<br><br>&lt;/code&gt;<br><br></span>Yes, The method was not called. However, the traceback was indeed printed by the print_exc, since there were no tracebacks before I added this line. In fact, as Gabriel Genellina said :
<span class="q"><br><br>&gt;That might provoke a ConflictError, forcing a<br>&gt;transaction abort and the request to be re-tried (up to three times,<br>&gt;silently, then it goes logged).<br><br></span>as well as&nbsp; Pascal Peregrina:
<span class="q"><br><br>&gt;In general, retry is called when a ZODB Conflict Error has happened.
<br>&gt;If I remember well, Zope will silently retry 3 times, and then actually<br>&gt;return an error page showing the Conflict Error.<br><br></span>as the documentation says <a href="http://www.zope.org/Documentation/Books/ZDG/current/ObjectPublishing.stx" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">

http://www.zope.org/Documentation/Books/ZDG/current/ObjectPublishing.stx</a> :<br><br>&quot;If an unhandled exception is raised during the publishing process, Zope aborts the transaction. As detailed in Chapter 4. Zope handles ConflictErrors by re-trying the request up to three times. This is done with the zpublisher_exception_hook.&quot;
<br><br>Thus, I don&#39;t think that the traceback is always shown when there&#39;s a conflict error.<br><br>So I decided to look into the file suggested by Maciej Wisniowski :<span class="q"><br><br>&gt;You may take a look at lib/python/ZODB/ConflictResolution.py
<br>&gt;method: tryToResolveConflict. There is a call to _p_resolveConflict.<br><br></span>and edited it like this :<br><br>&lt;code&gt;<br>def tryToResolveConflict(self, oid, committedSerial, oldSerial, newpickle,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; committedData=&#39;&#39;):
<br>&nbsp;&nbsp;&nbsp; # class_tuple, old, committed, newstate = (&#39;&#39;,&#39;&#39;), 0, 0, 0<br>&nbsp;&nbsp;&nbsp; print &quot;in ConflictResolution.py, called the tryToResolveConflict method with arguments :&quot;<br>&nbsp;&nbsp;&nbsp; print &quot;self&quot;,self,&quot;oid&quot;,oid.__repr__(),&quot;committedSerial&quot;,committedSerial.__repr__(),&quot;oldSerial&quot;,oldSerial.__repr__(),&quot;newpickle&quot;,newpickle.__repr__(),&quot;committedData&quot;,committedData.__repr__()
<br>&nbsp;&nbsp;&nbsp; try:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; prfactory = PersistentReferenceFactory()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; file = StringIO(newpickle)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unpickler = Unpickler(file)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unpickler.find_global = find_global<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unpickler.persistent_load

 = prfactory.persistent_load<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; meta = unpickler.load()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if isinstance(meta, tuple):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; klass = meta[0]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; newargs = meta[1] or ()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if isinstance(klass, tuple):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; klass = find_global(*klass)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; klass = meta<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; newargs = ()<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if klass in _unresolvable:<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print &quot;klass&quot;,klass.__repr__,&quot;is unresolvable&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return None
<br>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; newstate = unpickler.load()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inst = klass.__new__(klass, *newargs)<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; resolve = inst._p_resolveConflict<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; except AttributeError:<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print inst.__repr__,&quot;has no _p_resolveConflict method&quot;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _unresolvable[klass] = 1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return None<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; old = state(self, oid, oldSerial, prfactory)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; committed = state(self, oid, committedSerial, prfactory, committedData)<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; resolved = resolve(old, committed, newstate)
<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; file = StringIO()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pickler = Pickler(file,1)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pickler.persistent_id = persistent_id<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pickler.dump(meta)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pickler.dump(resolved)<br>&nbsp;&nbsp;&nbsp; print &quot;everything&#39;s ok&quot;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return file.getvalue(1)<br>&nbsp;&nbsp;&nbsp; except (ConflictError, BadClassName):<br>&nbsp;&nbsp;&nbsp; print &quot;ConflictError during conflict resolution in tryToResolveConflict, ConflictResolution.py&quot;<br>&nbsp;&nbsp;&nbsp; import traceback<br>

&nbsp;&nbsp;&nbsp; import sys<br>&nbsp;&nbsp;&nbsp; traceback.print_exc(file = sys.stdout)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return None<br>&nbsp;&nbsp;&nbsp; except:<br>&nbsp;&nbsp;&nbsp; print &quot;Exception raised in in tryToResolveConflict, ConflictResolution.py&quot;<br>&nbsp;&nbsp;&nbsp; import traceback<br>&nbsp;&nbsp;&nbsp; import sys
<br>&nbsp;&nbsp;&nbsp; traceback.print_exc(file=sys.stdout)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If anything else went wrong, catch it here and avoid passing an<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # arbitrary exception back to the client.&nbsp; The error here will mask<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # the original ConflictError.&nbsp; A client can recover from a
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # ConflictError, but not necessarily from other errors.&nbsp; But log<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # the error so that any problems can be fixed.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; logger.error(&quot;Unexpected error&quot;, exc_info=True)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return None
<br><br>&lt;/code&gt;<br><br>Now let&#39;s see what&#39;s going on in the console :<br><br>&lt;console&gt;<br>in ConflictResolution.py, called the tryToResolveConflict method with arguments :<br>self &lt;tempstorage.TemporaryStorage.TemporaryStorage

 instance at 0x43fb6aac&gt; oid &#39;\x00\x00\x00\x00\x00\x00\x00\t&#39; committedSerial &#39;\x03k#\x93\x1d\xff\xf5\x11&#39; oldSerial &#39;\x03k#\x91^t\xf1D&#39; newpickle &#39;(cProducts.Transience.Transience\nIncreaser\nq\x01

)tq\x02.J\x88\xa6\xb8E.&#39; committedData &#39;&#39;<br>ConflictError during conflict resolution in tryToResolveConflict, ConflictResolution.py<span class="q"><br>Traceback (most recent call last):<br></span>&nbsp; File &quot;/opt/aef/Zope-
2.9.0/lib/python/ZODB/ConflictResolution.py&quot;, line 126, in tryToResolveConflict
<br>&nbsp;&nbsp;&nbsp; old = state(self, oid, oldSerial, prfactory)<br>&nbsp; File &quot;/opt/aef/Zope-2.9.0/lib/python/ZODB/ConflictResolution.py&quot;, line 53, in state<br>&nbsp;&nbsp;&nbsp; p = p or self.loadSerial(oid, serial)<br>&nbsp; File &quot;/opt/aef/Zope-
2.9.0//lib/python/tempstorage/TemporaryStorage.py&quot;, line 148, in loadSerial<br>&nbsp;&nbsp;&nbsp; raise POSException.ConflictError(oid=oid)<br>ConflictError: database conflict error (oid 0x09)<br><br>&lt;comment&gt; the exception is raised up to the publish function, since it has not been catched, and I added up a code to print traceback in the publish function so here it is &lt;/comment&gt;
<span class="q"><br><br>exception raised in the publish module, in function publish<br>Traceback (most recent call last):<br>&nbsp; File &quot;/opt/aef/Zope-2.9.0/lib/python/ZPublisher/Publish.py&quot;, line 119, in publish<br>
&nbsp;&nbsp;&nbsp; transactions_manager.commit()
<br>&nbsp; File &quot;/opt/aef/Zope-2.9.0//lib/python/Zope2/App/startup.py&quot;, line 234, in commit<br>&nbsp;&nbsp;&nbsp; transaction.commit()<br>&nbsp; File &quot;/opt/aef/Zope-2.9.0//lib/python/transaction/_manager.py&quot;, line 96, in commit
<br>&nbsp;&nbsp;&nbsp; return self.get().commit(sub, deprecation_wng=False)<br>&nbsp; File &quot;/opt/aef/Zope-2.9.0//lib/python/transaction/_transaction.py&quot;, line 380, in commit<br>&nbsp;&nbsp;&nbsp; self._saveCommitishError() # This raises!<br>&nbsp; File &quot;/opt/aef/Zope-
2.9.0//lib/python/transaction/_transaction.py&quot;, line 378, in commit<br>&nbsp;&nbsp;&nbsp; self._commitResources()<br>&nbsp; File &quot;/opt/aef/Zope-2.9.0//lib/python/transaction/_transaction.py&quot;, line 433, in _commitResources<br>
&nbsp;&nbsp;&nbsp; 
rm.commit(self)<br>&nbsp; File &quot;/opt/aef/Zope-2.9.0//lib/python/ZODB/Connection.py&quot;, line 484, in commit<br>&nbsp;&nbsp;&nbsp; self._commit(transaction)<br>&nbsp; File &quot;/opt/aef/Zope-2.9.0//lib/python/ZODB/Connection.py&quot;, line 526, in _commit
<br>&nbsp;&nbsp;&nbsp; self._store_objects(ObjectWriter(obj), transaction)<br>&nbsp; File &quot;/opt/aef/Zope-2.9.0//lib/python/ZODB/Connection.py&quot;, line 554, in _store_objects<br>&nbsp;&nbsp;&nbsp; s = self._storage.store(oid, serial, p, self._version, transaction)
<br>&nbsp; File &quot;/opt/aef/Zope-2.9.0//lib/python/tempstorage/TemporaryStorage.py&quot;, line 200, in store<br>&nbsp;&nbsp;&nbsp; data=data)<br></span>ConflictError: database conflict error (oid 0x09, class Products.Transience.Transience.Increaser

, serial this txn started with 0x036b23915e74f144 2007-01-25 13:05:22.138314, serial currently committed 0x036b23931dfff511 2007-01-25 13:07:07.031211)<br>&lt;/console&gt;<br><br>The exception is raised, as the traceback says, in File &quot;/opt/aef/Zope-
2.9.0//lib/python/tempstorage/TemporaryStorage.py&quot;, line 148, in loadSerial<br>&nbsp;&nbsp;&nbsp; raise POSException.ConflictError(oid=oid)<br><br>Is it normal that the oid, as an argument to tryToResloveConflict, was &quot;\x00\x00\x00\x00\x00\x00\x00\t&quot; then became 0x09 when the exception was raised ?
<br><br>here&#39;s the loadSerial code :<br><br>&lt;code&gt;<br>&nbsp;&nbsp;&nbsp; def loadSerial(self, oid, serial, marker=[]):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;&quot;&quot; this is only useful to make conflict resolution work.&nbsp; It<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; does not actually implement all the semantics that a revisioning
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; storage needs! &quot;&quot;&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self._lock_acquire()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; data = self._conflict_cache.get((oid, serial), marker)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if data is marker:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # XXX Need 2 serialnos to pass them to ConflictError--
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # the old and the new<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; raise POSException.ConflictError(oid=oid)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return data[0] # data here is actually (data, t)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; finally:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self._lock_release()
<br><br>&lt;/code&gt;<br><br><div><span class="gmail_quote">2007/1/25, Martijn Pieters &lt;<a href="mailto:mj@zopatista.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">mj@zopatista.com</a>&gt;:
</span><div><span class="e" id="q_11059bb07ed202b9_15"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On 1/24/07, Maciej Wisniowski &lt;<a href="mailto:maciej.wisniowski@coig.katowice.pl" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">maciej.wisniowski@coig.katowice.pl</a>&gt; wrote:<br>&gt; Another question, do you use ZEO? I know there were some issues
<br>&gt; with _p_resolveConflict and ZEO (at last in Zope 
2.8.x). Result<br>&gt; was that with ZEO setup _p_resolveConflict was not called at all.<br>&gt; There is solution for this but I don&#39;t know if this is your case<br>&gt; especially that you are dealing with TemporaryStorage which is
<br>&gt; typically managed by ZEO Client...<br><br>If ZEO cannot reach your product (import it), it cannot run any<br>conflict resolution. Make sure that the ZEO server setup has access to<br>those Products that do conflict resolution.
<br><br>--<br>Martijn Pieters<br></blockquote></span></div></div><br>

</blockquote></div><br>