Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Detect index out of sync
Detect index out of sync [message #1859466] Fri, 09 June 2023 11:30 Go to next message
Frank Benoit is currently offline Frank BenoitFriend
Messages: 179
Registered: July 2009
Senior Member
Hi

In case, my application was terminated not properly (e.g. crash), the persisted index (ResourceDescriptions) may no more match the actual state.

As a solution - to bring the application again into a proper working state - a full build needs to be triggered.

Now I would like to automate this, so the user does not need to know about this.
Is there a way to detect this situation?

regards Frank
Re: Detect index out of sync [message #1859467 is a reply to message #1859466] Fri, 09 June 2023 12:24 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14699
Registered: July 2009
Senior Member
@frank are you talking about eclipse usecase?
emf based persister already should do this.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Fri, 09 June 2023 12:24]

Report message to a moderator

Re: Detect index out of sync [message #1859469 is a reply to message #1859467] Fri, 09 June 2023 14:52 Go to previous messageGo to next message
Frank Benoit is currently offline Frank BenoitFriend
Messages: 179
Registered: July 2009
Senior Member
Yes, in Eclipse based RCP.

Thanks for the pointer.
Indeed the EmfBasedPersister is triggered.
Now I understood that it does not really do a build, it just makes the build state to be removed.
I needed to add an incremental build to ensure the index is completely valid.
At least, this solved the bug/problem I am working on.
Is this expected? (the extra needed incremental build)
Re: Detect index out of sync [message #1859470 is a reply to message #1859469] Fri, 09 June 2023 15:04 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14699
Registered: July 2009
Senior Member
scheduleRecoveryBuild();
This should already be called
Does this not work ?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Fri, 09 June 2023 15:06]

Report message to a moderator

Re: Detect index out of sync [message #1859471 is a reply to message #1859470] Fri, 09 June 2023 15:13 Go to previous messageGo to next message
Frank Benoit is currently offline Frank BenoitFriend
Messages: 179
Registered: July 2009
Senior Member
Yes, it is always called. But in org.eclipse.xtext.builder.impl.BuildScheduler.scheduleBuildIfNecessary(Iterable<IProject>, IBuildFlag...) it goes into builderStateDiscarder.forgetLastBuildState and that's it.

What I try in my application:
import a project.
Use it -> OK
Terminate the application forcefully, reopen
Use the same project -> it fails
Terminate the application forcefully, reopen
run incremental build before use, then use it -> OK
Re: Detect index out of sync [message #1859472 is a reply to message #1859471] Fri, 09 June 2023 15:17 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14699
Registered: July 2009
Senior Member
Have no background why it is done this way
Maybe you can patch the forget last build state out
And do a full build instead


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:N-to-N code generation
Next Topic:xtext - Eclipse Application launch issue
Goto Forum:
  


Current Time: Sat Jul 27 16:54:58 GMT 2024

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

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

Back to the top