cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: caching persistent objects
Date Fri, 28 Apr 2006 12:55:00 GMT
On Apr 26, 2006, at 7:46 PM, Cypher ! wrote:
> how do I turn the QueryLogger on and off?

http://objectstyle.org/confluence/display/CAYDOC/Configuring+Logging

> The problem I am having is the application is hitting the database  
> for virtually every request and not caching any data at all. [...]  
> How do I enable shared caching and other types of caching

You need to understand that there is no single solution to persistent  
data caching that will address all situations, short of keeping the  
entire database in memory, but if you are using Oracle, this is  
probably not what you want. Still Cayenne provides a number of  
facilities to do smart caching. You'll need to understand them and  
apply as appropriate:

1. Query caching. I assume you've seen this page:

http://objectstyle.org/confluence/display/CAYDOC/Caching+Query+Results

A SHARED_CACHE policy is especially helpful when reading shared  
static data, such as a list of countries or us states, etc.


2. Prefetching - optimizing your queries:

http://objectstyle.org/confluence/display/CAYDOC/Prefetching


3. DataObjectUtils - object retrieval by PK will use shared cache if  
possible.


4. Relationship caching. This mostly applies to to-one relationships  
- cross-DataContext to-one relationships are automatically resolved  
from cache. You don't have to do anything.

Andrus

Mime
View raw message