No. Caching is enabled/disabled per persistent entity. You would need to add
the necessary caching strategy either in the configuration for each
persistent entity, or you need to add the caching instructions in the
hibernate config file. The entries in the configuration element below is
simply a master setting for enabling/disabling caching and it sets the cache
provider.

To add caching directly on the entities and collections you want to cache
using annotations add an annotation of the form:
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)

To add caching declarations in the hibernate configuration file add entries
of the form:
<class-cache class="class_name" usage="read-only"/>
<collection-cache collection="class_name.collection_name"
usage="read-only"/>

Mike

On 4/10/07, romsrini <[EMAIL PROTECTED]> wrote:


In the appfuse jars, in the applicationContext-dao.xml file, the following
configuration snippet exists:

<!-- EntityManagerFactory -->
   <bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean
">
       <property name="persistenceUnitManager"
ref="persistenceUnitManager"/>
       <property name="jpaProperties">
           <value>
               hibernate.dialect=${hibernate.dialect}
               hibernate.query.substitutions=true 'Y', false 'N'
               hibernate.cache.use_second_level_cache=true

hibernate.cache.provider_class=org.hibernate.cache.EhCacheProvider
           </value>
           <!-- Turn batching off for better error messages under
PostgreSQL -->
           <!-- hibernate.jdbc.batch_size=0 -->
       </property>
   </bean>

Does this mean all of our model objects are cached? If so, what type
(read-only, nonstrict-read-write, read-write) of cache is this? If not,
how
(and where) do we configure a cache of a specific type that only applies
to
subset of our model objects? I realize this is more of a hibernate
question,
but as appfuse is my introduction to both spring and hibernate, I am
hoping
you can help me understand how cacheing fits into appfuse.

Thank you,
Rom
--
View this message in context:
http://www.nabble.com/Cacheing-question-tf3554776s2369.html#a9925648
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to