[jboss-user] [JBoss Cache Users] - Re: Invalidation-only cache

2009-09-28 Thread adamw
One more question though - do I understand right from the javadoc that putForExternalRead is non-transactional? Meaning that if a change something in a TX in the persistent store, and then call putForExternalRead with the changes, other transactions will see the change, making it a dirty read?

[jboss-user] [JBoss Cache Users] - Re: Invalidation-only cache

2009-09-28 Thread adamw
Another idea, using JBC 1.4.1; for put operations, which shouldn't cause invalidation, maybe I could use an Option with cache mode == LOCAL. For the remove operation, I could use INVALIDATION_SYNC, which should propagate. Do you see any obstacles here? :) Adam View the original post :

[jboss-user] [JBoss Cache Users] - Re: Invalidation-only cache

2009-09-24 Thread adamw
Hello, well, from what I've seen in CacheHelper Hibernate is simply calling get() and put(). However in my case this doesn't work, as I run the cache in INVALIDATION_SYNC mode. This means that when I call put() on node1, an invalidation message is sent to other nodes. Then, when node 2 wants to

[jboss-user] [JBoss Cache Users] - Re: Invalidation-only cache

2009-09-24 Thread manik.surt...@jboss.com
Have a look at Hibernate, again. :-) They too use INVALIDATION, and there is a way to deal with this - it's called putForExternalRead(). As for the CL approach, that will not work, this scenario is not what the CL is designed for. View the original post :

[jboss-user] [JBoss Cache Users] - Re: Invalidation-only cache

2009-09-24 Thread adamw
Ah yes, didn't notice it, thanks a lot! :) Adam View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=4256854#4256854 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=4256854 ___ jboss-user

[jboss-user] [JBoss Cache Users] - Re: Invalidation-only cache

2009-09-23 Thread adamw
Hello, but if I call get() in the TX that did the changes, I want to get a re-calculated value basing on the changed persistent store. Other threads should get of course the old value. Adam View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=4256534#4256534 Reply

[jboss-user] [JBoss Cache Users] - Re: Invalidation-only cache

2009-09-23 Thread mircea.markus
even within a TX, I would expect that if you ask for a node that is not in the memory the cache store still to be queried and data fetched from there. Just for me to make sure I get it right, you have something like: tx.start() | cache.remove(fqn); //this will clear data from both memory AND

[jboss-user] [JBoss Cache Users] - Re: Invalidation-only cache

2009-09-23 Thread adamw
Hello, Well, if I call cache.remove(fqn) in a tx, then any subsequent calls return null, without hitting the cache loader. Only after the tx is commited, the cache loader is queried. (In the no-tx scenario it behaves as if the tx was commited immediately after the operation.) That's what my

[jboss-user] [JBoss Cache Users] - Re: Invalidation-only cache

2009-09-23 Thread mircea.markus
ah I see. Out of ideas then :( View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=4256605#4256605 Reply to the post : http://www.jboss.org/index.html?module=bbop=postingmode=replyp=4256605 ___ jboss-user mailing list

[jboss-user] [JBoss Cache Users] - Re: Invalidation-only cache

2009-09-23 Thread mircea.markus
anonymous wrote : Heh, I didn't expect that my use case will be so uncommon. It seems a relatively simple idea to store some computed values and invalidate them when the underlying data changes. But well ... :) Well apparently this is the first time one asks for this functionality :) One thing

[jboss-user] [JBoss Cache Users] - Re: Invalidation-only cache

2009-09-23 Thread adamw
Heh, I didn't expect that my use case will be so uncommon. It seems a relatively simple idea to store some computed values and invalidate them when the underlying data changes. But well ... :) Adam View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=4256619#4256619

[jboss-user] [JBoss Cache Users] - Re: Invalidation-only cache

2009-09-23 Thread adamw
Hello, yes, I'm doing that now for a limited number of keys (eagerly putting them in the cache instead of removing the whole node), although I'm doing it inside the TX (I want the new values to be calculated basing on the data modified in the TX), however I can't do that for all keys, as that

[jboss-user] [JBoss Cache Users] - Re: Invalidation-only cache

2009-09-23 Thread manik.surt...@jboss.com
I think you are using the cache loader in an incorrect way. CLs are designed to be a persistent (and overflow) extension to memory and should never be sued to store a different form of data. And should also never change externally outside the cache system. If you want to cache stuff from a

[jboss-user] [JBoss Cache Users] - Re: Invalidation-only cache

2009-09-22 Thread mircea.markus
can't you do the get call outside a transaction? You can use TransactionManager.suspend/resume if you need to do some more work in tx after refreshing the cache. View the original post : http://www.jboss.org/index.html?module=bbop=viewtopicp=4256397#4256397 Reply to the post :