On 2016-09-19 05:32, Ali Kefia wrote: > May be I missed something but it is worth asking a question: > When we have 2 workers, W1 and W2, working on an instance (call it a > product), how to manage this situation: > > - W1 added product to cache (from database) > - W2 modified product and cleared ITS product cache > - W1 makes get on product cache => hit an invalid version > > We can not check db on each cache.get call?
You can not add to Cache Model instance because they are linked to the transaction. The Cache objects only store base type and the invalidation is managed by the developer with the call to clear. It is all the cache that is cleared so it is quite raw but normally Cache should only be used for data that almost never change. -- Cédric Krier - B2CK SPRL Email/Jabber: cedric.kr...@b2ck.com Tel: +32 472 54 46 59 Website: http://www.b2ck.com/ -- You received this message because you are subscribed to the Google Groups "tryton-dev" group. To view this discussion on the web visit https://groups.google.com/d/msgid/tryton-dev/20160919145707.GM29096%40tetsuo.