[CDO] Long running ModelSet.save may result in TimeoutException [message #1729940] |
Wed, 20 April 2016 07:57  |
Eclipse User |
|
|
|
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
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04498 seconds