[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [Subclipse-users] Resources are out of synch after Replace with Latest from Repository

From: jcompagner <jcompagner_at_gmail.com>
Date: Tue, 7 Jul 2009 15:57:35 +0200

I think you encounter the same problems we have in our plugin/product.
We did work around it (cant remember it exactly anymore how)

The problem is that all modifications of the recources that subclipse
touches do happen outside of eclipse own control.

Nothing is done through the eclipse Resource api. Every change is just
written to disk by the outside part (JavaHL or SVNKit)
and then subclipse called refresh on those files or project.

This also did bite us because we also didnt expect certain events at one
time. That just where interfering with the normal stuff we expect.
Those events did go right through resource locks and so on.

This is not really fixable i think in subclipse ,especially with the JavaHL
layer.. maybe SVNKit could help here.
By abstracting the File api so that you give SVNKit a abstract file api
provider that goes through eclipse api for reading/writing files.
But in the native JavaHL call this is just not possible to fix. :(

johan

On Tue, Jul 7, 2009 at 15:38, <Sascha.Theves_at_innovations.de> wrote:

> Hi all,
>
>
>
> we have very big problems running subclipse together with our product.
>
> Our product listens to resource change events and reads the content of some
> files if they were changed. That works fine in all cases except if you make
> an update from a subclipse repository.
>
> When we invoke “Replace With -> Latest from Repository” and files were
> changed we got the following exceptions:
>
>
>
> Caused by: org.eclipse.core.internal.resources.ResourceException: The
> resource tree is locked for modifications.
>
> at
> org.eclipse.core.internal.resources.WorkManager.checkIn(WorkManager.java:115)
>
> at
> org.eclipse.core.internal.resources.Workspace.prepareOperation(Workspace.java:1747)
>
> at
> org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1478)
>
> at
> org.eclipse.core.internal.resources.File.refreshLocal(File.java:342)
>
> at
> org.eclipse.emf.ecore.resource.impl.PlatformResourceURIHandlerImpl$WorkbenchHelper.createPlatformResourceInputStream(PlatformResourceURIHandlerImpl.java:202)
>
> ... 24 more
>
>
>
> And that exception occurs if we want to read the content from a file and
> the file is out of synch. We call (EMF does it) file.refreshLocal if the
> file is out of synch before reading the content. And there the exception
> occurs because the resource tree is locked for modifications to that time.
> After this resource change event no other events occur. So we can not wait
> until we get an event where the resource tree is not locked. No other Team
> Provider or Eclipse itself sends such resource change events. It only occurs
> with subclipse and I think it is a bug. So our questions are:
>
>
>
> - Why are the files out of synch if we make an update?
>
> - Why are the files still out of synch when we receive the
> resource change events?
>
> - Why does no other change events occur if the file was synched?
>
> - Is there a workaround for the problem? (Reading the content of
> the file in another Thread when the resource is not locked is not a solution
> for us!)
>
>
>
> I think subclipse does not conform to the resource API from Eclipse in this
> case.
>
>
>
> Any ideas/help would be useful!
>
>
>
> Kind regards,
>
>
>
> Sascha Theves
>
>
>

------------------------------------------------------
http://subclipse.tigris.org/ds/viewMessage.do?dsForumId=1047&dsMessageId=2368855

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subclipse.tigris.org].
Received on 2009-07-07 15:58:08 CEST

This is an archived mail posted to the Subclipse Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.