Bug 100712

Summary: Error with "rollback"
Product: [Retired] Red Hat Web Application Framework Reporter: Randy Graebner <randyg>
Component: persistenceAssignee: Rafael H. Schloming <rafaels>
Status: CLOSED CANTFIX QA Contact: Jon Orris <jorris>
Severity: medium Docs Contact:
Priority: medium    
Version: nightlyCC: tross
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-01-03 20:03:46 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Randy Graebner 2003-07-24 15:05:38 UTC
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.

Comment 1 Vadim Nasardinov 2003-07-24 15:12:41 UTC
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. 
 
 

Comment 2 Rafael H. Schloming 2003-07-29 20:17:16 UTC
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.

Comment 3 Jon Orris 2003-08-05 15:49:44 UTC
Needs a test case

Comment 4 David Lawrence 2006-07-18 02:58:10 UTC
QA_READY has been deprecated in favor of ON_QA. Please use ON_QA in the future.
Moving to ON_QA.