<div class="gmail_quote">On Thu, Mar 22, 2012 at 2:45 PM, Vincent Pelletier <span dir="ltr"><<a href="mailto:plr.vincent@gmail.com">plr.vincent@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Le jeudi 22 mars 2012 18:23:47, Claudiu Saftoiu a écrit :<br>
<div class="im">> Ahh, now that looks promising. Are there any particularly good places to<br>
> get documentation on that sort of thing? All I see when I google are<br>
> mailing list archives.<br>
<br>
</div>See ZODB/ConflictResolution.txt . Disclaimer: I didn't read it. I read the<br>
code - but I expect the text file to be easier to assimilate :) .<br>
BTrees/Length.py:Length class implements a simple _p_resolveConflict (yours<br>
will be even simpler).<br></blockquote><div><br></div><div>Thanks, I will take a look.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">There should be some details in the exceptoin itself. Like, oids, currently</div>
commited TID and the TID transaction started with. root()._p_jar[the_oid] will<br>
get you the object. Then the hard part starts: guess where in the object tree<br>
that object is. If you have varied classes, and significant data on your<br>
persistent instances, it will be easy.<br></blockquote><div><br></div><div>Ok, I just got a ConflictError:</div><div><br></div><div><div>ConflictError: database conflict error (oid 0x139c35, class BTrees.OOBTree.OOBucket, serial this txn started with 0x03954ed053c0ff88 2012-03-22 16:48:19.629820, serial currently committed 0x03954f996d61c944 2012-03-22 20:09:25.636401)</div>
</div><div><br></div><div>in my paster shell I do:</div><div><br></div><div><div>In [14]: root._p_jar[0x139c35]</div></div><div><br></div><div>However, this causes:</div><div><br></div><div><div>In [14]: root._p_jar[0x139c35]</div>
<div>ERROR: An unexpected error occurred while tokenizing input</div><div>The following traceback may be corrupted or invalid</div><div>The error message is: ('EOF in multi-line statement', (85, 0))</div><div><br>
</div><div>---------------------------------------------------------------------------</div><div>TypeError Traceback (most recent call last)</div><div><br></div><div>/home/tsa/sports/<ipython console> in <module>()</div>
<div><br></div><div>/home/tsa/env/lib/python2.6/site-packages/ZODB/Connection.pyc in get(self, oid)</div><div> 246 return obj</div><div> 247</div><div>--> 248 p, serial = self._storage.load(oid, '')</div>
<div> 249 obj = self._reader.getGhost(p)</div><div> 250</div><div><br></div><div>/home/tsa/env/lib/python2.6/site-packages/ZEO/ClientStorage.pyc in load(self, oid, version)</div><div> 813 self._lock.acquire() # for atomic processing of invalidations</div>
<div> 814 try:</div><div>--> 815 t = self._cache.load(oid)</div><div> 816 if t:</div><div> 817 return t</div><div><br></div><div>/home/tsa/env/lib/python2.6/site-packages/ZEO/cache.pyc in call(*args, **kw)</div>
<div> 141 inst._lock.acquire()</div><div> 142 try:</div><div>--> 143 return self.func(inst, *args, **kw)</div><div> 144 finally:</div><div> 145 inst._lock.release()</div>
<div><br></div><div>/home/tsa/env/lib/python2.6/site-packages/ZEO/cache.pyc in load(self, oid)</div><div> 487 @locked</div><div> 488 def load(self, oid):</div><div>--> 489 ofs = self.current.get(oid)</div>
<div> 490 if ofs is None:</div><div> 491 self._trace(0x20, oid)</div><div><br></div><div>/home/tsa/env/lib/python2.6/site-packages/ZODB/fsIndex.pyc in get(self, key, default)</div><div> 123</div>
<div> 124 def get(self, key, default=None):</div><div>--> 125 tree = self._data.get(key[:6], default)</div><div> 126 if tree is default:</div><div> 127 return default</div><div>
<br></div><div>TypeError: 'int' object is unsubscriptable</div></div><div><br></div><div>What am I doing wrong?</div><div><br></div><div>Thanks again,</div><div>- Claudiu</div></div>