Cache management in Morphia 1.5 and 2.2

39 views
Skip to first unread message

Ww

unread,
Mar 11, 2022, 3:32:36 AM3/11/22
to Morphia
Hi all,

I am trying to upgrade my Morphia from version 1.5.8 to 2.2.3. And then I encountered an issue. Seems the whole cache stuff are removed in the newer version. My question is how to do the cache in version of 2.2.3.

In 1.5.8. I used:
dev.morphia.mapping.cache.EntityCache
dev.morphia.mapping.cache.EntityCacheFactory

Setup the Morphia:
morphia.createDatastore​(MongoClient, Mapper, dbName)

The Mapper in the above is configured with:
mapper.getOptions().setCacheFactory(EntityCacheFactory);

So you can see as EntityCacheFactory and setCacheFactory() were removed. I wonder how can I refactor my code to use the Morphia 2.2.3

I would appreciate if you have any ideas
Reply all
Reply to author
Forward
0 new messages