You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently I stumbled upon the same problem as described in #914, where I have to upsert a value (using this library) and then retrieve it by calling Entity.findById - it returns cached entity with outdated values. I've solved that by calling Entity.removeFromCache after doing an upsert, but that got me thinking
How safe is it to be using DSL queries alongside DAO? Is entity cache somehow updated/invalidated when DSL queries are performed?
In other words, if I update an entity without explicitly committing/flushing, and then call some service which performs a DSL query to find this entity - will I see the updated value? Not necessarily interested in this particular case, but in similar cases in general, where you have a mix of DSL/DAO operations within the same transaction
Should I stick to DSL only if I want to avoid possible cache-related problems?
Asking because DAO API is not as flexible, so I have to be doing DSL queries in between.
The text was updated successfully, but these errors were encountered:
Hi!
Recently I stumbled upon the same problem as described in #914, where I have to upsert a value (using this library) and then retrieve it by calling
Entity.findById
- it returns cached entity with outdated values. I've solved that by callingEntity.removeFromCache
after doing an upsert, but that got me thinkingHow safe is it to be using DSL queries alongside DAO? Is entity cache somehow updated/invalidated when DSL queries are performed?
In other words, if I update an entity without explicitly committing/flushing, and then call some service which performs a DSL query to find this entity - will I see the updated value? Not necessarily interested in this particular case, but in similar cases in general, where you have a mix of DSL/DAO operations within the same transaction
Should I stick to DSL only if I want to avoid possible cache-related problems?
Asking because DAO API is not as flexible, so I have to be doing DSL queries in between.
The text was updated successfully, but these errors were encountered: