tmlab/majortom

creating an association leads to empty Changeset

Closed this issue · 7 comments

What steps will reproduce the problem?
1. create Topic assocType with History off
2. createAssociation(assocType)
3. call revisionIndex.firstRevision.changeSet

What is the expected output? What do you see instead?
A changeSet with at least the change of type "ASSOCIATION_CREATED".
Instead: empty changeSet and the next revision holds the information I expected 
in the first (empty) one.


Original issue reported on code.google.com by schulze....@googlemail.com on 20 Sep 2010 at 7:50

Original comment by schulze....@googlemail.com on 20 Sep 2010 at 7:50

  • Changed title: creating an association leads to empty Changeset
createAssociation(assocType) with History on, of course.

Original comment by schulze....@googlemail.com on 20 Sep 2010 at 7:54

Hi,

I write the following short test which works, as expected. 

--------------------------------------------------------------
IRevisionIndex index = topicMap.getIndex(IRevisionIndex.class);
index.open();
assertNull(index.getFirstRevision());

topicMap.getStore().enableRevisionManagement(false);
ITopic type = createTopic();
assertNull(index.getFirstRevision());

topicMap.getStore().enableRevisionManagement(true);
assertNull(index.getFirstRevision());

topicMap.createAssociation(type);
assertNotNull(index.getFirstRevision());
IRevision r = index.getFirstRevision();
assertEquals(3, r.getChangeset().size());
assertNull(r.getFuture());
--------------------------------------------------------------

Can you post your code snippet which does not works as expected?


Original comment by Sven.Kro...@googlemail.com on 20 Sep 2010 at 9:31

Sorry for the Ruby Spec code.

@tm.topics.should be_empty
@tm.revision_index.last_revision.should be_nil
@tm.disable_revision_management
@tm.get!("assoc_type")
@tm.enable_revision_management
@tm.revision_index.last_revision.should be_nil
@tm.create_association("assoc_type")
@tm.all_revisions.each do |revision|
  changeset = revision.changeset
  changeset.should_not be_empty
end

all_revisions is an Array of revisions, starting with last_revision and calling 
past until no revision is left.

Original comment by schulze....@googlemail.com on 20 Sep 2010 at 9:41

If I call

first_revision = @tm.revision_index.first_revision
first_revision.should_not be_nil
first_revision.changeset.should_not be_empty

then the changeset of the first revision is also empty.

Original comment by schulze....@googlemail.com on 20 Sep 2010 at 9:44

Original comment by Sven.Kro...@googlemail.com on 20 Sep 2010 at 10:13

  • Added labels: InMemory
I see the problem, the bug only exists in the in-memory topic map store.

I fixed it and deploy it to maven dependency management

Original comment by Sven.Kro...@googlemail.com on 20 Sep 2010 at 10:29

  • Changed state: Fixed