As Gabriel Genellina said earlier in this discussion, the probleme could come from the dicoLignes variable that is stored in the session.I don't get it, the exception says that the Increaser object is responsible of the conflict error :
ZODB.POSException.ConflictError database conflict error (oid 0x09,
class Products.Transience.Transience.Increaser, serial this txn started
with 0x036b192256c66688 2007-01-23 16:34:20.337891, serial currently
committed 0x036b19236a4be0ee 2007-01-23 16:35:24.913219)
But the Increaser class has a _p_resolveConflict method :
<code>
class Increaser(Persistent):
"""
A persistent object representing a typically increasing integer that
has conflict resolution which uses the greatest integer out of the three
available states.
"""
...
def _p_resolveConflict(self, old, state1, state2):
return max(old, state1, state2)
</code>
http://www.zope.org/Members/jim/ZODB/ApplicationLevelConflictResolution says :
"" When a conflict is detected, then the
database checks to see if the class of the object being saved defines
the method, _p_resolveConflict. If the method is defined, then the
method is called on the object. If the method succeeds, then the object
change can be committed, otherwise a ConflictError is raised as
usual.""
But how can the simple instruction return max(old,state1,state2) not "succeed" ??!!
anyway, i decided to rewrite it like this :
<code>
def _p_resolveConflict(self, old, state1, state2):
try:
number = max(old,state1,state2)
except Exception,msg:
import traceback
traceback.print_exc(file=sys.stdin)
return max(old, state1, state2)
</code>
And still the same exception is raised !
<traceback on the console>
exception raised in the publish module, in function publish
Traceback (most recent call last):
File "/opt/aef/Zope-
2.9.0/lib/python/ZPublisher/Publish.py", line 119, in publish
transactions_manager.commit()
File "/opt/aef/Zope-2.9.0//lib/python/Zope2/App/startup.py", line 234, in commit
transaction.commit
()
File "/opt/aef/Zope-2.9.0//lib/python/transaction/_manager.py", line 96, in commit
return self.get().commit(sub, deprecation_wng=False)
File "/opt/aef/Zope-2.9.0//lib/python/transaction/_transaction.py", line 380, in commit
self._saveCommitishError() # This raises!
File "/opt/aef/Zope-2.9.0//lib/python/transaction/_transaction.py", line 378, in commit
self._commitResources()
File "/opt/aef/Zope-2.9.0//lib/python/transaction/_transaction.py", line 433, in _commitResources
rm.commit(self)
File "/opt/aef/Zope-2.9.0//lib/python/ZODB/Connection.py", line 484, in commit
self._commit(transaction)
File "/opt/aef/Zope-2.9.0//lib/python/ZODB/Connection.py", line 526, in _commit
self._store_objects(ObjectWriter(obj), transaction)
File "/opt/aef/Zope-2.9.0//lib/python/ZODB/Connection.py", line 554, in _store_objects
s = self._storage.store(oid, serial, p, self._version, transaction)
File "/opt/aef/Zope-2.9.0//lib/python/tempstorage/TemporaryStorage.py", line 200, in store
data=data)
ConflictError: database conflict error (oid 0x09, class Products.Transience.Transience.Increaser
, serial this txn started with 0x036b1eec70e150ee 2007-01-24 17:16:26.456283, serial currently committed 0x036b1eee46e27955 2007-01-24 17:18:16.613593)
</traceback>
(i edited publish.py and added a traceback.print_exc
(file=stdin) instruction in the beginning of the except block).
Y.Chaouche
> And here is the exception that is raised:
>
> exception raised in the publish module, in function publish
> ZODB.POSException.ConflictError database conflict error (oid 0x09, class
> Products.Transience.Transience.Increaser, serial this txn started with
> 0x036b192256c66688 2007-01-23 16:34:20.337891, serial currently committed
> 0x036b19236a4be0ee 2007-01-23 16:35:24.913219)
>
> What happend ?
Sorry for doing that but I'll send you to list archives.
There were a lot of threads about conflict errors. I think
you'll find them helpful.
--
Maciej Wisniowski