Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » [CDO] Long running ModelSet.save may result in TimeoutException
[CDO] Long running ModelSet.save may result in TimeoutException [message #1729940] Wed, 20 April 2016 11:57 Go to next message
Thorsten Schlathölter is currently offline Thorsten SchlathölterFriend
Messages: 309
Registered: February 2012
Location: Düsseldorf
Senior Member
The CDOAwareModelSet of Papyrus has a save method into which an IProgressMonitor is passed. This monitor is used internally for a commit that adjusts specific xrefs. The progress monitor is not passed down to the actual save of internal IModels. What is more the IModel interface does not even allow to pass in an IProgressMonitor. As a result long running updates/inserts cause a TimeoutException which can be avoided if the IProgressMonitor would be passed into the commit.

This is the implementation of EMFLogicalModel. Note that it just calls resource.save(null).
@Override
	public void saveModel() throws IOException {
		final ModelSet set = getModelManager();

		for (Resource resource : getResources()) {
			if (set.shouldSave(resource)) {
				try {
					resource.save(null);
				} catch (IOException ex) {
					// If an exception occurs, we should not prevent other resources from being saved.
					// This would probably make things even worse. Catch and log.
					Activator.log.error(ex);
				}
			}
		}
	}



The respective save in CDOResourceImpl just calls commit without monitor:

 public void save(Map<?, ?> options) throws IOException
  {
    CDOTransaction transaction = getTransaction(options);
    IProgressMonitor progressMonitor = options != null
        ? (IProgressMonitor)options.get(CDOResource.OPTION_SAVE_PROGRESS_MONITOR) : null;

    try
    {
      transaction.commit(progressMonitor);
    }
    catch (CommitException ex)
    {
      throw new TransactionException(ex);
    }

    setModified(false);
  }


I think it is necessary to provide a possibility to pass down a Monitor down to the cdo commit.

Should I raise a Bugzilla on this or am I missing something?


Regards,
Thorsten


Re: [CDO] Long running ModelSet.save may result in TimeoutException [message #1729950 is a reply to message #1729940] Wed, 20 April 2016 12:54 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1237
Registered: July 2009
Location: Canada
Senior Member

Hi, Thorsten,

I agree. The ModelSet saving protocol should accept a progress monitor
and so should the IModels. please raise an enhancement request.

As the Neon release is now past API Freeze, this would be something
that I would like to see addressed in Oxygen.

Cheers,

Christian


On 2016-04-20 11:57:54 +0000, Thorsten Schlathölter said:

> The CDOAwareModelSet of Papyrus has a save method into which an
> IProgressMonitor is passed. This monitor is used internally for a
> commit that adjusts specific xrefs. The progress monitor is not passed
> down to the actual save of internal IModels. What is more the IModel
> interface does not even allow to pass in an IProgressMonitor. As a
> result long running updates/inserts cause a TimeoutException which can
> be avoided if the IProgressMonitor would be passed into the commit.
>
> This is the implementation of EMFLogicalModel. Note that it just calls
> resource.save(null).
> @Override
> public void saveModel() throws IOException {
> final ModelSet set = getModelManager();
>
> for (Resource resource : getResources()) {
> if (set.shouldSave(resource)) {
> try {
> resource.save(null);
> } catch (IOException ex) {
> // If an exception occurs, we should not prevent other resources
> from being saved.
> // This would probably make things even worse. Catch and log.
> Activator.log.error(ex);
> }
> }
> }
> }
>
>
>
> The respective save in CDOResourceImpl just calls commit without monitor:
>
>
> public void save(Map<?, ?> options) throws IOException
> {
> CDOTransaction transaction = getTransaction(options);
> IProgressMonitor progressMonitor = options != null
> ?
> (IProgressMonitor)options.get(CDOResource.OPTION_SAVE_PROGRESS_MONITOR)
> : null;
>
> try
> {
> transaction.commit(progressMonitor);
> }
> catch (CommitException ex)
> {
> throw new TransactionException(ex);
> }
>
> setModified(false);
> }
>
>
> I think it is necessary to provide a possibility to pass down a Monitor
> down to the cdo commit.
> Should I raise a Bugzilla on this or am I missing something?
>
>
> Regards,
> Thorsten
Re: [CDO] Long running ModelSet.save may result in TimeoutException [message #1730011 is a reply to message #1729950] Wed, 20 April 2016 21:03 Go to previous message
Thorsten Schlathölter is currently offline Thorsten SchlathölterFriend
Messages: 309
Registered: February 2012
Location: Düsseldorf
Senior Member
https://bugs.eclipse.org/bugs/show_bug.cgi?id=492126
Previous Topic:Setting String attribute back to null
Next Topic:Viewpoint "generic" diagram kind
Goto Forum:
  


Current Time: Wed Jan 27 08:41:43 GMT 2021

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

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

Back to the top