Enforce Second Level cache


In my application I have an entity with few transient Collection fields, these are constantly updateing very fast and access to those fields is needs to be fast too, thus I dont persist them (also this information is temporary and doesent need to be kept).

I suppose that entity modified is the same that is cached in 2nd level cache. so that if i request that entity again I will get actually the same object with already ready state. Not sure about this but please leave your comment on this (is it really the same object kept in cache)....

Now the problem is that I need to have guarantee that this entity object is kept in cache all the time (there are not many of these entities), is it possible to enforce objectdb to cache all instances of that entities in 2nd level cache.

Thanks for time


The 1st level cache (in the EntityManager) keeps objects with all their fields, including transient.

The 2nd level cache keeps only the data from the db as byte[], so transient fields are excluded.

There is no way to enforce keeping an object in the 2nd level cache.


ObjectDB Support