Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] How delete all revisions of object?
[CDO] How delete all revisions of object? [message #1797423] Tue, 30 October 2018 17:45 Go to next message
DENIS B is currently offline DENIS BFriend
Messages: 3
Registered: June 2017
Junior Member
Hi. Some EMF objects that are no longer needed remain in the database. It is possible to delete all revisions of certain type of EMF Object from CDO Store?
I try to write script for that, but i could not calculate the number of nodes for ERESOURCE_CDORESOURCEFOLDER for each revision. Maybe exist any legal way to do this?

[Updated on: Tue, 30 October 2018 18:04]

Report message to a moderator

Re: [CDO] How delete all revisions of object? [message #1797427 is a reply to message #1797423] Tue, 30 October 2018 18:24 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6457
Registered: July 2009
Senior Member
Hi Denis,

Your problem description confuses me a bit.

Are you using CDO's auditing (or branching) mode and want to know how to delete historical CDORevisions of a given EObject? If so, that's not possible because it would defeat the purpose of an audit. Being able to reduce the size of the history would be a nice thing, but difficult to achieve. https://bugs.eclipse.org/bugs/show_bug.cgi?id=256490 is there, already.

Or do you want to know how to delete all EObjects of a given EClass from the HEAD of a given branch, which, if you don't use the auditing (or branching) mode, is equivalent to all EObjects of that EClass from the entire repository? That can be accomplished with code like this:

      CDOTransaction transaction = session.openTransaction(branch);
      List<EAnnotation> annotations = transaction.queryInstances(EcorePackage.Literals.EANNOTATION);
      for (EAnnotation annotation : annotations)
      {
        EcoreUtil.remove(annotation);
      }

      transaction.commit();


Re: [CDO] How delete all revisions of object? [message #1797430 is a reply to message #1797427] Tue, 30 October 2018 19:11 Go to previous message
DENIS B is currently offline DENIS BFriend
Messages: 3
Registered: June 2017
Junior Member
Thank you for answer. Yes, i mean CDO in branching mode. Ok, after 10 day of try write correct sql script, i just will remove object from HEAD and will wait for feature "Add feature to purge revision history to reduze size".))
Previous Topic:ViewerRefresh delay break setting selection
Next Topic:Unusable EMF plugins in release 2018-09
Goto Forum:
  


Current Time: Thu Dec 05 22:50:05 GMT 2019

Powered by FUDForum. Page generated in 0.01895 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top