Skip to main content



      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 07:57 Go to next message
Eclipse UserFriend
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 08:54 Go to previous messageGo to next message
Eclipse UserFriend
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 17:03 Go to previous message
Eclipse UserFriend
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 Jul 23 14:28:54 EDT 2025

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

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

Back to the top