Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » on OnChangeEvictingCache and JvmModelInferrer
on OnChangeEvictingCache and JvmModelInferrer [message #1233703] Mon, 20 January 2014 10:03 Go to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1770
Registered: July 2009
Location: Firenze, Italy
Senior Member
Hi

I've just started using OnChangeEvictingCache to cache some model
computation operations; these operations are called in the inferrer,
validator and label provider. However, I noted with debugging that the
values cached during the inferrer are lost. If I understand correctly,
this happens because:

- the cache is cleared when the resource semantically changes
- the inferrer inserts in the resource the inferred elements (thus the
resource changes and the cache is cleared)

of course I can still use the values cached by the validator in the
label provider, but I was wondering whether this is the expected
behavior... should I implement a custom cache that does not consider
the elements inserted in the resource by the inferrer?

thanks in advance
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book


Re: on OnChangeEvictingCache and JvmModelInferrer [message #1235128 is a reply to message #1233703] Thu, 23 January 2014 16:17 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Yes, it is expected. The cache is also cleared when ever there's a
change in the model.

Am 20/01/14 11:03, schrieb Lorenzo Bettini:
> Hi
>
> I've just started using OnChangeEvictingCache to cache some model
> computation operations; these operations are called in the inferrer,
> validator and label provider. However, I noted with debugging that the
> values cached during the inferrer are lost. If I understand correctly,
> this happens because:
>
> - the cache is cleared when the resource semantically changes
> - the inferrer inserts in the resource the inferred elements (thus the
> resource changes and the cache is cleared)
>
> of course I can still use the values cached by the validator in the
> label provider, but I was wondering whether this is the expected
> behavior... should I implement a custom cache that does not consider
> the elements inserted in the resource by the inferrer?
>
> thanks in advance
> Lorenzo
>


--
Need professional support for Xtext or other Eclipse Modeling technologies?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : http://blog.efftinge.de
Re: on OnChangeEvictingCache and JvmModelInferrer [message #1238701 is a reply to message #1233703] Sun, 02 February 2014 05:01 Go to previous message
Anil Bhatia is currently offline Anil BhatiaFriend
Messages: 23
Registered: February 2011
Junior Member
I noticed this loss of cached data too...

In my scenario, I have a top level element in my model (this element is specified by the user initially, and only once, and does not occur in the model again). Based upon the value in this model some expensive computations have to be done, and I would like to store the results into cache.

I do not want this part of the cache to be cleaned unless the user comes back to this element and changes its value again.

Isn't there a way to link cache entry with a model element, saying - do not evict this, unless this element changes... (irrespective of whether the cache is accessed from inferrer, validator, or label provider) ?
Previous Topic:Creating new Xtext resource through code
Next Topic:Some comments disappear when model is manipulated
Goto Forum:
  


Current Time: Thu Nov 26 10:41:03 GMT 2020

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

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

Back to the top