Description of problem: I have created a page that displays the history of a document along with a link to roll the document back to a given transaction. When clicking on the link for earlier transactions I get the below error. For more recent transactions, the operation succeeds. However, trying to roll back to the same transaction twice gives the error as does rolling back to a transaction (say 200) and then trying to roll back to an earlier transaction (say 100). I will try to create a unit test to demonstrate this functionality. java.lang.IllegalArgumentException: merging into nonexistent node: to= <node events: [set [com.arsdigita.docs.DocBlobject:{id=3176}].contentResource null, create [com.arsdigita.docs.DocBlobject:{id=3175}], set [com.arsdigita.docs.DocBlobject:{id=3175}].id 3175, set [com.arsdigita.docs.DocBlobject:{id=3175}].contentResource [kpmg.orion.documents.tax.TaxDocument:{id=3165}], set [kpmg.orion.documents.tax.TaxDocument:{id=3165}].content [com.arsdigita.docs.DocBlobject:{id=3175}]] deps: []> from= <node events: [set [com.arsdigita.docs.DocBlobject:{id=3175}].content [B@512a7e0f] deps: [create [com.arsdigita.docs.DocBlobject:{id=3175}]]> at com.redhat.persistence.engine.rdbms.Aggregator.merge(Aggregator.java:95) at com.redhat.persistence.engine.rdbms.Aggregator.onSet(Aggregator.java:276) at com.redhat.persistence.SetEvent.dispatch(SetEvent.java(Compiled Code)) at com.redhat.persistence.engine.rdbms.RDBMSEngine.write(RDBMSEngine.java:267) at com.redhat.persistence.Session.flushInternal(Session.java(Compiled Code)) at com.redhat.persistence.Session.flush(Session.java:482) at com.arsdigita.persistence.DataObjectImpl.delete(DataObjectImpl.java:341) at com.arsdigita.versioning.ProxyDataObject.deleteIfTerminal(ProxyDataObject.java:578) at com.arsdigita.versioning.RollbackRecord.removeTerminalObjects(RollbackRecord.java:323) at com.arsdigita.versioning.RollbackRecord.rollback(RollbackRecord.java:148) at com.arsdigita.versioning.Versions.rollback(Versions.java:158) at kpmg.orionweb.document.ViewDocumentHistoryAction.execute(ViewDocumentHistoryAction.java:66) Version-Release number of selected component (if applicable): Tip How reproducible: Always Steps to Reproduce: I am working on creating a unit test for it but first I have to get my unit tests running.
If you look at //core-platform/dev/test/src/com/arsdigita/versioning, you may find machinery that may be useful to you. In particular, look at the fakeCommit() method in VersioningEventProcessorTest. It allows you fake multiple "transactions" within a single db transaction. This is useful for bugs that can only be reproduced across two or more distinct db transactions.
This bug is fixed on the tip. The exception was caused by the internal data structures used by Aggregator.java becoming inconsistent. I changed those data structures in such a way that it is impossible for them to become inconsistent in this manner. Randy reports that this does in fact fix the problem, but it is difficult to verify this independently since we don't have an isolated test case that demonstrates the problem.
Needs a test case
QA_READY has been deprecated in favor of ON_QA. Please use ON_QA in the future. Moving to ON_QA.