Questions tagged [second-level-cache]

Second-level-cache, as the name implies, is a layer of cache that lives between a "primary" cache and a data service/store (relational database, in most cases) to optimize read operations on the service/store. It is different from the primary cache in its lifespan (primary cache being limited to a request lifetime) and capabilities (persist to store, clustering, etc.).

Second-level-cache, as the name implies, is a layer of cache that lives between a "primary" cache and a data service/store (relational database, in most cases) to optimize read operations on the service/store. It is different from the primary cache in its lifespan (primary cache being limited to a request lifetime) and capabilities (persist to store, clustering, etc.).

Second-level-cache is a concept most often encountered in the context of object-persistence frameworks, such as Hibernate. The idea is to allow the persistence engine to maintain a copy of entities that are available in the data service/store so that queries to retrieve them can be fulfilled using a local lookup as opposed to a full roundtrip to the service/store which invariably lives in a different server, thus requiring a network operation and incurring the associated overhead and latency/performance impact.

350 questions
0
votes
2 answers

Cache all queries by default using hibernate/ehcache?

Our application handles read-only data, so we are considering using Hibernate query cache features (implemented by ehcache) on all queries. So far we enabled both second level and query caches:
Pierre Duplouy
  • 2,415
  • 5
  • 23
  • 24
0
votes
1 answer

Configure shared cache mode in hibernate

I am using spring - hibernate integration and I have hibernate.cfg.xml which has session-factory node in xml. In persistense.xml with jpa I have used shred-cache-mode for second level caching. I want to configure the same with hibernate config file…
Nimesh
  • 794
  • 3
  • 8
  • 18
0
votes
1 answer

What hibernate second level cache contains immediately after the server start up?

What will be present in the hibernate second level cache immediately after the server startup and before firing any actual request. Will it be empty or will it read any data from the data base? Thanks in adavance
Bhargav Kumar R
  • 2,190
  • 3
  • 22
  • 38
0
votes
1 answer

Different cache concurrent strategies for root entity and its collection (Hibernate with EHCache)?

Given example from Hibernate docs and modifying it so that root level entity (Customer) is read-only while one of its collections (tickets) is read-write: @Entity @Cache(usage = CacheConcurrencyStrategy.READ_ONLY) public class Customer { ... …
topchef
  • 19,091
  • 9
  • 63
  • 102
0
votes
1 answer

How to cache an object with a key which is not owned by the object, using ehcache?

I am fairly new to ehcache and as far as I know on method level the cacheing is working on the id of object to be cached. However I have a different situation. I have a User class and a role class, the relation between them is many-to-many and…
hevi
  • 2,432
  • 1
  • 32
  • 51
0
votes
1 answer

Garbage collection when Ehcache is used for hibernate second level cache

When Ehcache is used for hibernate second level cache, do the objects in echache get garbage collected by the JVM?
fatih tekin
  • 959
  • 10
  • 21
0
votes
3 answers

NHibernate Caching Dilemma

My application includes a client, web tier (load balanced), application tier (load balanced), and database tier. The web tier exposes services to clients, and forwards calls onto the application tier. The application tier then executes queries…
Kent Boogaart
  • 175,602
  • 35
  • 392
  • 393
0
votes
1 answer

Plugging in Ehcache (second level caching) with lucene

I want to cache the results returned by lucene search using some second level caching framework for faster cached responses. How can I achieve that?
Ajay Bhojak
  • 1,161
  • 9
  • 17
0
votes
1 answer

Configuration of Level 1 and Level 2 cache in JPA

I have read the following pages and I have several doubts. About the persistence context type for Level 1 cache What is the difference between Transaction-scoped Persistence context and Extended Persistence context? About the Level 2…
Aliuk
  • 1,249
  • 2
  • 17
  • 32
0
votes
1 answer

Using ASP.NET Caching on top of NHibernate 2nd Level Caching

Should i consider using ASP.NET Caching to cache query results on top of NHibernate 2nd Level Caching to improve performances ?
Yoann. B
  • 11,075
  • 19
  • 69
  • 111
0
votes
2 answers

Hibernate Second-Level Cache, Shared between different JVM

I am in interested to know if the Hibernate Second-Level caching can be shared between two different Hibernate session running on two different JVM. I am using Hibernate 3.1 with Ehcache to provide second-level caching, and in the Ehcache.xml config…
0
votes
1 answer

What is the recommended way to doing nhibernate session management in asp.net-mvc that supports second level cache / transactions, etc?

I am struggling to get second level caching and transactions working in my asp.net-mvc site and I am thinking it has to do with how I have my session managements setup. Basically I have the following…
leora
  • 188,729
  • 360
  • 878
  • 1,366
0
votes
2 answers

NHibernate 2nd level cache provider for NHibernate 2.1.1.4000

I am using s#arp which is built against NHibernate 2.1.1.4000, However I would like to use NHibernate.Caches.SysCache as my second level cache. However the Nhibernate contrib caches are built against NHibernate 2.1.2.4000 which obviously gives me a…
Rippo
  • 22,117
  • 14
  • 78
  • 117
0
votes
1 answer

What is the correct way to use nhibernate transactions and second level cache on an asp.net-mvc page?

I have a number of pages that run 10 t0 15 different queries to build up a page. I see from a few articles, to have nhibernate second level cache working I need to use transactions. So I want to confirm that i should be putting all of those 10 to…
leora
  • 188,729
  • 360
  • 878
  • 1,366
0
votes
1 answer

Unable to configure second level cache in hibernate 4.x

I am using hibernate 4.3 and MySQL 5.0.I am trying to configure a second level cache in my example as follows. My hibernate.cfg.xml true
Prashant Shilimkar
  • 8,402
  • 13
  • 54
  • 89