Enhancement 59 : Caching persistant objects
Priority 
High
Reported Version 
 
Logged By 
Paul
Status 
Fixed
Fixed Version 
2.1.0
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
14/01/2009
Updated 
14/01/2009
Type 
Enhancement
 
Attachments 
No attachments

It would be good if an object that has already been read from persistent storage could be used as a result from a find operation rather than re-reading the database. There are many open source libraries that can help with this task.

A corner enhancement would be an ability to declare a desire to force a single memory representation of a given persistent instance.

 
Rob 15 Sep 10:09
Addressed in 2.1.0

With v2.1.0 you can declaratively or programmatically specify if you want 'readOnly' beans from a query.

When returning 'readOnly' beans from cache Ebean can return the instance from the cache (referred to as shared instances). Shared instances are readOnly and if you try to call a setter method then a IllegalStateException is thrown.

Shared instances can lazy load other beans and these are all loaded as shared instances - the sharedInstance property is propagated to any lazy loaded beans.

Rob 15 Sep 10:12
@CacheStrategy

With v2.1.0 @CacheStrategy has been introduced.

This means that instead of explicitly specifying to use the cache via query.setUseCache(true) ... you can just put @CacheStrategy on the bean type, and then any query using that bean (directly or via join) will use the cache.

Rob 15 Sep 10:12
Addressed in v2.1.0

Addressed in v2.1.0

woResponse

Upload a file