SlideShare ist ein Scribd-Unternehmen logo
1 von 24
nHibernate Caching Albert Kuo 1
Database Transaction nHibernate Caching nHibernate Caching Implementation Reference 2 Agenda
Database Transaction 3
Understanding database transactions 4
NHibernateITransaction API 5
NHibernateITransaction API 6
nHibernate Caching 7
Used for optimizing database applications. A cache is designed to reduce traffic between your application and the database by conserving data already loaded from the database. Database access is necessary only when retrieving data that is not currently available in the cache. The application may need to empty (invalidate) the cache from time to time if the database is updated or modified in some way, because it has no way of knowing whether the cache is up to date What is caching? 8
nHibernate Cache Persistence context cache Pluggable, scope is process or cluster 9
Two different Caches First-level cache Second-level cache associated with the Session object Hibernate uses first-level cache on a per transaction basis (within a single transaction boundary) Used mainly to reduce the number of SQL queries it needs to generate within a given transaction. For example, if an object is modified several times within the same transaction, Hibernate will generate only one SQL UPDATE statement at the end of the transaction, containing all the modifications associated with the SessionFactory object Second-level cache keeps loaded objects at the Session Factory level across transaction boundaries The objects in the second-level cache are available to the whole application, not just to the user running the query This way, each time a query returns an object that is already loaded in the cache, one or more database transactions potentially are avoided. 10
Use it when you need to cache actual query results, rather than just persistent objects Query-level Cache 11
nHibernate Caching Implementation 12
http://nhforge.org/media/p/6.aspx Where to download 13
14 Cache Providers You can choose one of provider to use
How to configure? Prevalence SysCache 15
How to configure? Prevalence SysCache 16 Add four properties into <session-factory> <!-- nHibernate Cache configuration --> <property name="cache.provider_class">NHibernate.Caches.Prevalence.PrevalenceCacheProvider, NHibernate.Caches.Prevalence</property> <property name="cache.use_query_cache">true</property> <property name="cache.use_second_level_cache">true</property> <property name="cache.default_expiration">120</property> Add four properties into <session-factory> <!-- nHibernate Cache configuration --> <property name="cache.provider_class">NHibernate.Caches.SysCache.SysCacheProvider,NHibernate.Caches.SysCache</property> <property name="cache.use_query_cache">true</property> <property name="cache.use_second_level_cache">true</property> <property name="cache.default_expiration">120</property>
How to configure ? – cont. 17
18 How to configure ? – cont.
How to configure ? – cont. Configure caching strategy for each mapping file 19
read only If your application needs to read but never modify instances of a persistent class, a read-only cache may be used. This is the simplest and best performing strategy. read/write If the application needs to update data, a read-write cache might be appropriate. This cache strategy should never be used if serializable transaction isolation level is required. nonstrict read/write If the application only occasionally needs to update data and strict transaction isolation is not required, a nonstrict-read-write cache might be appropriate. Cache StrategieCache Strategies (for Second-Level) 20
21 Run Search Function
2009-10-01 16:36:49,250 INFO NHibernate.Cfg.SettingsFactory.CreateCacheProvider(:0)  - cache provider: NHibernate.Caches.Prevalence.PrevalenceCacheProvider, NHibernate.Caches.Prevalence 2009-10-01 16:36:49,250 INFO NHibernate.Cfg.SettingsFactory.BuildSettings(:0)  - query cache factory: NHibernate.Cache.StandardQueryCacheFactory 2009-10-01 16:36:49,578 DEBUG NHibernate.Cache.CacheFactory.CreateCache(:0)  - cache for: HelloNHibernate.vo.Contact usage strategy: read-write 2009-10-01 16:36:49,750 DEBUG NHibernate.Cache.CacheFactory.CreateCache(:0)  - cache for: HelloNHibernate.vo.People usage strategy: read-write 2009-10-01 16:36:50,125 DEBUG NHibernate.Loader.Loader.InitializeEntitiesAndCollections(:0)  - total objects hydrated: 3 2009-10-01 16:36:50,125 DEBUG NHibernate.Engine.TwoPhaseLoad.InitializeEntity(:0)  - resolving associations for [HelloNHibernate.vo.People#3] 2009-10-01 16:36:50,140 DEBUG NHibernate.Engine.Loading.LoadContexts.LocateLoadingCollection(:0)  - creating collection wrapper:[HelloNHibernate.vo.People.Contacts#3] 2009-10-01 16:36:50,140 DEBUG NHibernate.Engine.TwoPhaseLoad.InitializeEntity(:0)  - adding entity to second-level cache: [HelloNHibernate.vo.People#3] 2009-10-01 16:36:50,140 DEBUG NHibernate.Cache.ReadWriteCache.Put(:0)  - Caching: HelloNHibernate.vo.People#3 2009-10-01 16:36:50,140 DEBUG NHibernate.Caches.Prevalence.PrevalenceCache.Get(:0)  - Fetching object 'NHibernate-Cache:HelloNHibernate.vo.People:HelloNHibernate.vo.People#3@3' from the cache. 2009-10-01 16:36:50,156 DEBUG NHibernate.Cache.ReadWriteCache.Put(:0)  - Item was already cached: HelloNHibernate.vo.People#3 22 Check log – Prevalence Set cache provider Cache strategy Fetch data from cache
2009-10-19 13:21:27,046 DEBUG NHibernate.Cache.ReadWriteCache.Get(:0)  - Cache lookup: Persistence.vo.CaseState#0 2009-10-19 13:21:27,046 DEBUG NHibernate.Caches.SysCache.SysCache.Get(:0)  - Fetching object 'NHibernate-Cache:Persistence.vo.CaseState:Persistence.vo.CaseState#0@0' from the cache. 2009-10-19 13:21:27,046 DEBUG NHibernate.Cache.ReadWriteCache.Get(:0)  - Cache hit: Persistence.vo.CaseState#0 2009-10-19 13:21:27,046 DEBUG NHibernate.Event.Default.DefaultLoadEventListener.AssembleCacheEntry(:0)  - assembling entity from second-level cache: [Persistence.vo.CaseState#0] 2009-10-19 13:21:27,046 DEBUG NHibernate.Event.Default.DefaultLoadEventListener.AssembleCacheEntry(:0)  - Cached Version:  2009-10-19 13:21:27,046 DEBUG NHibernate.Event.Default.DefaultLoadEventListener.DoLoad(:0)  - resolved object in second-level cache: [Persistence.vo.CaseState#0] 2009-10-19 13:21:27,046 DEBUG NHibernate.Engine.TwoPhaseLoad.InitializeEntity(:0)  - adding entity to second-level cache: [Persistence.vo.Cases#200910090114] 2009-10-19 13:21:27,046 DEBUG NHibernate.Cache.ReadWriteCache.Put(:0)  - Caching: Persistence.vo.Cases#200910090114 2009-10-19 13:21:27,046 DEBUG NHibernate.Caches.SysCache.SysCache.Get(:0)  - Fetching object 'NHibernate-Cache:Persistence.vo.Cases:Persistence.vo.Cases#200910090114@-909291618' from the cache. 2009-10-19 13:21:27,046 DEBUG NHibernate.Cache.ReadWriteCache.Put(:0)  - Item was already cached: Persistence.vo.Cases#200910090114 23 Check log – SysCache
nHibernate in Action, Manning, 2009/2 http://www.manning.com/kuate/ nHibernate online doc: Chapter 14. Improving performance https://www.hibernate.org/hib_docs/nhibernate/html/performance.html nHibernate online doc: Chapter 20. NHibernate.Caches https://www.hibernate.org/hib_docs/nhibernate/html/caches.html NHibernate考察系列 06 进阶篇 http://www.cnblogs.com/riccc/archive/2007/04/17/nhibernate-entity-lifecycle-secondary-cache-interceptor.html NHibernate之旅(22):探索NHibernate一级缓存 http://www.cnblogs.com/lyj/archive/2008/11/24/1340253.html 24 Reference

Weitere ähnliche Inhalte

Was ist angesagt?

Apache Tajo - Bay Area HUG Nov. 2013 LinkedIn Special Event
Apache Tajo - Bay Area HUG Nov. 2013 LinkedIn Special EventApache Tajo - Bay Area HUG Nov. 2013 LinkedIn Special Event
Apache Tajo - Bay Area HUG Nov. 2013 LinkedIn Special EventGruter
 
Building Hybrid data cluster using PostgreSQL and MongoDB
Building Hybrid data cluster using PostgreSQL and MongoDBBuilding Hybrid data cluster using PostgreSQL and MongoDB
Building Hybrid data cluster using PostgreSQL and MongoDBAshnikbiz
 
Akamai Edge: Tracking the Performance of the Web with HTTP Archive
Akamai Edge: Tracking the Performance of the Web with HTTP ArchiveAkamai Edge: Tracking the Performance of the Web with HTTP Archive
Akamai Edge: Tracking the Performance of the Web with HTTP ArchiveRick Viscomi
 
Tracking the Performance of the Web with HTTP Archive
Tracking the Performance of the Web with HTTP ArchiveTracking the Performance of the Web with HTTP Archive
Tracking the Performance of the Web with HTTP ArchiveRick Viscomi
 
Zend Server Data Caching
Zend Server Data CachingZend Server Data Caching
Zend Server Data CachingEl Taller Web
 
Infrastructure Monitoring with Postgres
Infrastructure Monitoring with PostgresInfrastructure Monitoring with Postgres
Infrastructure Monitoring with PostgresSteven Simpson
 
Gruter TECHDAY 2014 Realtime Processing in Telco
Gruter TECHDAY 2014 Realtime Processing in TelcoGruter TECHDAY 2014 Realtime Processing in Telco
Gruter TECHDAY 2014 Realtime Processing in TelcoGruter
 
Rolling Out Apache HBase for Mobile Offerings at Visa
Rolling Out Apache HBase for Mobile Offerings at Visa Rolling Out Apache HBase for Mobile Offerings at Visa
Rolling Out Apache HBase for Mobile Offerings at Visa HBaseCon
 
2011 06-30-hadoop-summit v5
2011 06-30-hadoop-summit v52011 06-30-hadoop-summit v5
2011 06-30-hadoop-summit v5Samuel Rash
 
HBaseCon 2013: Being Smarter Than the Smart Meter
HBaseCon 2013: Being Smarter Than the Smart MeterHBaseCon 2013: Being Smarter Than the Smart Meter
HBaseCon 2013: Being Smarter Than the Smart MeterCloudera, Inc.
 
Efficient in situ processing of various storage types on apache tajo
Efficient in situ processing of various storage types on apache tajoEfficient in situ processing of various storage types on apache tajo
Efficient in situ processing of various storage types on apache tajoHyunsik Choi
 
Argus Production Monitoring at Salesforce
Argus Production Monitoring at SalesforceArgus Production Monitoring at Salesforce
Argus Production Monitoring at SalesforceHBaseCon
 
HBaseConAsia2018 Track1-1: Use CCSMap to improve HBase YGC time
HBaseConAsia2018 Track1-1: Use CCSMap to improve HBase YGC timeHBaseConAsia2018 Track1-1: Use CCSMap to improve HBase YGC time
HBaseConAsia2018 Track1-1: Use CCSMap to improve HBase YGC timeMichael Stack
 
Oncrawl elasticsearch meetup france #12
Oncrawl elasticsearch meetup france #12Oncrawl elasticsearch meetup france #12
Oncrawl elasticsearch meetup france #12Tanguy MOAL
 
OpenStack LA meetup Feb 18, 2015
OpenStack LA meetup Feb 18, 2015OpenStack LA meetup Feb 18, 2015
OpenStack LA meetup Feb 18, 2015Tesora
 
HBaseConAsia2018 Track3-6: HBase at Meituan
HBaseConAsia2018 Track3-6: HBase at MeituanHBaseConAsia2018 Track3-6: HBase at Meituan
HBaseConAsia2018 Track3-6: HBase at MeituanMichael Stack
 
RaptorX: Building a 10X Faster Presto with hierarchical cache
RaptorX: Building a 10X Faster Presto with hierarchical cacheRaptorX: Building a 10X Faster Presto with hierarchical cache
RaptorX: Building a 10X Faster Presto with hierarchical cacheAlluxio, Inc.
 
Using Approximate Data for Small, Insightful Analytics (Ben Kornmeier, Protec...
Using Approximate Data for Small, Insightful Analytics (Ben Kornmeier, Protec...Using Approximate Data for Small, Insightful Analytics (Ben Kornmeier, Protec...
Using Approximate Data for Small, Insightful Analytics (Ben Kornmeier, Protec...DataStax
 
Hybrid data lake on google cloud with alluxio and dataproc
Hybrid data lake on google cloud  with alluxio and dataprocHybrid data lake on google cloud  with alluxio and dataproc
Hybrid data lake on google cloud with alluxio and dataprocAlluxio, Inc.
 

Was ist angesagt? (20)

Apache Tajo - Bay Area HUG Nov. 2013 LinkedIn Special Event
Apache Tajo - Bay Area HUG Nov. 2013 LinkedIn Special EventApache Tajo - Bay Area HUG Nov. 2013 LinkedIn Special Event
Apache Tajo - Bay Area HUG Nov. 2013 LinkedIn Special Event
 
Building Hybrid data cluster using PostgreSQL and MongoDB
Building Hybrid data cluster using PostgreSQL and MongoDBBuilding Hybrid data cluster using PostgreSQL and MongoDB
Building Hybrid data cluster using PostgreSQL and MongoDB
 
Jee conf
Jee confJee conf
Jee conf
 
Akamai Edge: Tracking the Performance of the Web with HTTP Archive
Akamai Edge: Tracking the Performance of the Web with HTTP ArchiveAkamai Edge: Tracking the Performance of the Web with HTTP Archive
Akamai Edge: Tracking the Performance of the Web with HTTP Archive
 
Tracking the Performance of the Web with HTTP Archive
Tracking the Performance of the Web with HTTP ArchiveTracking the Performance of the Web with HTTP Archive
Tracking the Performance of the Web with HTTP Archive
 
Zend Server Data Caching
Zend Server Data CachingZend Server Data Caching
Zend Server Data Caching
 
Infrastructure Monitoring with Postgres
Infrastructure Monitoring with PostgresInfrastructure Monitoring with Postgres
Infrastructure Monitoring with Postgres
 
Gruter TECHDAY 2014 Realtime Processing in Telco
Gruter TECHDAY 2014 Realtime Processing in TelcoGruter TECHDAY 2014 Realtime Processing in Telco
Gruter TECHDAY 2014 Realtime Processing in Telco
 
Rolling Out Apache HBase for Mobile Offerings at Visa
Rolling Out Apache HBase for Mobile Offerings at Visa Rolling Out Apache HBase for Mobile Offerings at Visa
Rolling Out Apache HBase for Mobile Offerings at Visa
 
2011 06-30-hadoop-summit v5
2011 06-30-hadoop-summit v52011 06-30-hadoop-summit v5
2011 06-30-hadoop-summit v5
 
HBaseCon 2013: Being Smarter Than the Smart Meter
HBaseCon 2013: Being Smarter Than the Smart MeterHBaseCon 2013: Being Smarter Than the Smart Meter
HBaseCon 2013: Being Smarter Than the Smart Meter
 
Efficient in situ processing of various storage types on apache tajo
Efficient in situ processing of various storage types on apache tajoEfficient in situ processing of various storage types on apache tajo
Efficient in situ processing of various storage types on apache tajo
 
Argus Production Monitoring at Salesforce
Argus Production Monitoring at SalesforceArgus Production Monitoring at Salesforce
Argus Production Monitoring at Salesforce
 
HBaseConAsia2018 Track1-1: Use CCSMap to improve HBase YGC time
HBaseConAsia2018 Track1-1: Use CCSMap to improve HBase YGC timeHBaseConAsia2018 Track1-1: Use CCSMap to improve HBase YGC time
HBaseConAsia2018 Track1-1: Use CCSMap to improve HBase YGC time
 
Oncrawl elasticsearch meetup france #12
Oncrawl elasticsearch meetup france #12Oncrawl elasticsearch meetup france #12
Oncrawl elasticsearch meetup france #12
 
OpenStack LA meetup Feb 18, 2015
OpenStack LA meetup Feb 18, 2015OpenStack LA meetup Feb 18, 2015
OpenStack LA meetup Feb 18, 2015
 
HBaseConAsia2018 Track3-6: HBase at Meituan
HBaseConAsia2018 Track3-6: HBase at MeituanHBaseConAsia2018 Track3-6: HBase at Meituan
HBaseConAsia2018 Track3-6: HBase at Meituan
 
RaptorX: Building a 10X Faster Presto with hierarchical cache
RaptorX: Building a 10X Faster Presto with hierarchical cacheRaptorX: Building a 10X Faster Presto with hierarchical cache
RaptorX: Building a 10X Faster Presto with hierarchical cache
 
Using Approximate Data for Small, Insightful Analytics (Ben Kornmeier, Protec...
Using Approximate Data for Small, Insightful Analytics (Ben Kornmeier, Protec...Using Approximate Data for Small, Insightful Analytics (Ben Kornmeier, Protec...
Using Approximate Data for Small, Insightful Analytics (Ben Kornmeier, Protec...
 
Hybrid data lake on google cloud with alluxio and dataproc
Hybrid data lake on google cloud  with alluxio and dataprocHybrid data lake on google cloud  with alluxio and dataproc
Hybrid data lake on google cloud with alluxio and dataproc
 

Andere mochten auch

Nhibernate Part 2
Nhibernate   Part 2Nhibernate   Part 2
Nhibernate Part 2guest075fec
 
"ORMs – Entity Framework and NHibernate" - Bob Davidson, South Dakota Code Ca...
"ORMs – Entity Framework and NHibernate" - Bob Davidson, South Dakota Code Ca..."ORMs – Entity Framework and NHibernate" - Bob Davidson, South Dakota Code Ca...
"ORMs – Entity Framework and NHibernate" - Bob Davidson, South Dakota Code Ca...Blend Interactive
 
NHibernate in Action (Parte 1)
NHibernate in Action (Parte 1)NHibernate in Action (Parte 1)
NHibernate in Action (Parte 1)DotNetMarche
 
NHibernate - SQLBits IV
NHibernate - SQLBits IVNHibernate - SQLBits IV
NHibernate - SQLBits IVBen Hall
 
Nhibernate Part 1
Nhibernate   Part 1Nhibernate   Part 1
Nhibernate Part 1guest075fec
 
NHibernate from inside
NHibernate from insideNHibernate from inside
NHibernate from insideAndriy Buday
 
Entity and NHibernate ORM Frameworks Compared
Entity and NHibernate ORM Frameworks ComparedEntity and NHibernate ORM Frameworks Compared
Entity and NHibernate ORM Frameworks ComparedZoltan Iszlai
 
Introduction to NHibernate
Introduction to NHibernateIntroduction to NHibernate
Introduction to NHibernateDublin Alt,Net
 
NHibernate for .NET
NHibernate for .NETNHibernate for .NET
NHibernate for .NETGuo Albert
 
NHibernate (The ORM For .NET Platform)
NHibernate (The ORM For .NET Platform)NHibernate (The ORM For .NET Platform)
NHibernate (The ORM For .NET Platform)Samnang Chhun
 
Руйнуємо .NET Міфи
Руйнуємо .NET МіфиРуйнуємо .NET Міфи
Руйнуємо .NET МіфиSerhiy Kalinets
 
Micro orm для жизни. Кожевников Дмитрий D2D Just.NET
Micro orm для жизни. Кожевников Дмитрий D2D Just.NETMicro orm для жизни. Кожевников Дмитрий D2D Just.NET
Micro orm для жизни. Кожевников Дмитрий D2D Just.NETDev2Dev
 
Domain Driven Design Demonstrated
Domain Driven Design Demonstrated Domain Driven Design Demonstrated
Domain Driven Design Demonstrated Alan Christensen
 

Andere mochten auch (20)

Nhibernate Part 2
Nhibernate   Part 2Nhibernate   Part 2
Nhibernate Part 2
 
"ORMs – Entity Framework and NHibernate" - Bob Davidson, South Dakota Code Ca...
"ORMs – Entity Framework and NHibernate" - Bob Davidson, South Dakota Code Ca..."ORMs – Entity Framework and NHibernate" - Bob Davidson, South Dakota Code Ca...
"ORMs – Entity Framework and NHibernate" - Bob Davidson, South Dakota Code Ca...
 
NHibernate
NHibernateNHibernate
NHibernate
 
OpenERP 6.0
OpenERP 6.0OpenERP 6.0
OpenERP 6.0
 
Hibernate
HibernateHibernate
Hibernate
 
NHibernate in Action (Parte 1)
NHibernate in Action (Parte 1)NHibernate in Action (Parte 1)
NHibernate in Action (Parte 1)
 
NHibernate - SQLBits IV
NHibernate - SQLBits IVNHibernate - SQLBits IV
NHibernate - SQLBits IV
 
Ddd
DddDdd
Ddd
 
Nhibernate Part 1
Nhibernate   Part 1Nhibernate   Part 1
Nhibernate Part 1
 
NHibernate from inside
NHibernate from insideNHibernate from inside
NHibernate from inside
 
Entity and NHibernate ORM Frameworks Compared
Entity and NHibernate ORM Frameworks ComparedEntity and NHibernate ORM Frameworks Compared
Entity and NHibernate ORM Frameworks Compared
 
Introduction to NHibernate
Introduction to NHibernateIntroduction to NHibernate
Introduction to NHibernate
 
NHibernate
NHibernateNHibernate
NHibernate
 
NHibernate
NHibernateNHibernate
NHibernate
 
NHibernate for .NET
NHibernate for .NETNHibernate for .NET
NHibernate for .NET
 
ASP.Net MVC
ASP.Net MVCASP.Net MVC
ASP.Net MVC
 
NHibernate (The ORM For .NET Platform)
NHibernate (The ORM For .NET Platform)NHibernate (The ORM For .NET Platform)
NHibernate (The ORM For .NET Platform)
 
Руйнуємо .NET Міфи
Руйнуємо .NET МіфиРуйнуємо .NET Міфи
Руйнуємо .NET Міфи
 
Micro orm для жизни. Кожевников Дмитрий D2D Just.NET
Micro orm для жизни. Кожевников Дмитрий D2D Just.NETMicro orm для жизни. Кожевников Дмитрий D2D Just.NET
Micro orm для жизни. Кожевников Дмитрий D2D Just.NET
 
Domain Driven Design Demonstrated
Domain Driven Design Demonstrated Domain Driven Design Demonstrated
Domain Driven Design Demonstrated
 

Ähnlich wie nHibernate Caching

Html5 cache mechanism & local storage
Html5 cache mechanism & local storageHtml5 cache mechanism & local storage
Html5 cache mechanism & local storageSendhil Kumar Kannan
 
Sitecore Personalization on websites cached on CDN servers
Sitecore Personalization on websites cached on CDN serversSitecore Personalization on websites cached on CDN servers
Sitecore Personalization on websites cached on CDN serversAnindita Bhattacharya
 
10 Cache Implementation
10  Cache Implementation10  Cache Implementation
10 Cache ImplementationRanjan Kumar
 
Application Scalability in Server Farms - NCache
Application Scalability in Server Farms - NCacheApplication Scalability in Server Farms - NCache
Application Scalability in Server Farms - NCacheAlachisoft
 
Spring One 2 GX 2014 - CACHING WITH SPRING: ADVANCED TOPICS AND BEST PRACTICES
Spring One 2 GX 2014 - CACHING WITH SPRING: ADVANCED TOPICS AND BEST PRACTICESSpring One 2 GX 2014 - CACHING WITH SPRING: ADVANCED TOPICS AND BEST PRACTICES
Spring One 2 GX 2014 - CACHING WITH SPRING: ADVANCED TOPICS AND BEST PRACTICESMichael Plöd
 
NCache 3.8 SP3
NCache 3.8 SP3NCache 3.8 SP3
NCache 3.8 SP3wesnoor
 
thinking in key value stores
thinking in key value storesthinking in key value stores
thinking in key value storesBhasker Kode
 
Clug 2011 March web server optimisation
Clug 2011 March  web server optimisationClug 2011 March  web server optimisation
Clug 2011 March web server optimisationgrooverdan
 
Handling Relational Data in a Distributed Cache
Handling Relational Data in a Distributed CacheHandling Relational Data in a Distributed Cache
Handling Relational Data in a Distributed CacheAlachisoft
 
Scale Apache with Nginx
Scale Apache with NginxScale Apache with Nginx
Scale Apache with NginxBud Siddhisena
 
Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...ColdFusionConference
 
Developing High Performance and Scalable ColdFusion Applications Using Terrac...
Developing High Performance and Scalable ColdFusion Applications Using Terrac...Developing High Performance and Scalable ColdFusion Applications Using Terrac...
Developing High Performance and Scalable ColdFusion Applications Using Terrac...Shailendra Prasad
 
Four Ways to Improve ASP .NET Performance and Scalability
 Four Ways to Improve ASP .NET Performance and Scalability Four Ways to Improve ASP .NET Performance and Scalability
Four Ways to Improve ASP .NET Performance and ScalabilityAlachisoft
 
Tips and Tricks For Faster Asp.NET and MVC Applications
Tips and Tricks For Faster Asp.NET and MVC ApplicationsTips and Tricks For Faster Asp.NET and MVC Applications
Tips and Tricks For Faster Asp.NET and MVC ApplicationsSarvesh Kushwaha
 
Apache Traffic Server
Apache Traffic ServerApache Traffic Server
Apache Traffic Serversupertom
 
Academy PRO: HTML5 Data storage
Academy PRO: HTML5 Data storageAcademy PRO: HTML5 Data storage
Academy PRO: HTML5 Data storageBinary Studio
 

Ähnlich wie nHibernate Caching (20)

Html5 cache mechanism & local storage
Html5 cache mechanism & local storageHtml5 cache mechanism & local storage
Html5 cache mechanism & local storage
 
Scaling PHP apps
Scaling PHP appsScaling PHP apps
Scaling PHP apps
 
Sitecore Personalization on websites cached on CDN servers
Sitecore Personalization on websites cached on CDN serversSitecore Personalization on websites cached on CDN servers
Sitecore Personalization on websites cached on CDN servers
 
10 Cache Implementation
10  Cache Implementation10  Cache Implementation
10 Cache Implementation
 
Application Scalability in Server Farms - NCache
Application Scalability in Server Farms - NCacheApplication Scalability in Server Farms - NCache
Application Scalability in Server Farms - NCache
 
Spring One 2 GX 2014 - CACHING WITH SPRING: ADVANCED TOPICS AND BEST PRACTICES
Spring One 2 GX 2014 - CACHING WITH SPRING: ADVANCED TOPICS AND BEST PRACTICESSpring One 2 GX 2014 - CACHING WITH SPRING: ADVANCED TOPICS AND BEST PRACTICES
Spring One 2 GX 2014 - CACHING WITH SPRING: ADVANCED TOPICS AND BEST PRACTICES
 
NCache 3.8 SP3
NCache 3.8 SP3NCache 3.8 SP3
NCache 3.8 SP3
 
thinking in key value stores
thinking in key value storesthinking in key value stores
thinking in key value stores
 
Clug 2011 March web server optimisation
Clug 2011 March  web server optimisationClug 2011 March  web server optimisation
Clug 2011 March web server optimisation
 
Handling Relational Data in a Distributed Cache
Handling Relational Data in a Distributed CacheHandling Relational Data in a Distributed Cache
Handling Relational Data in a Distributed Cache
 
Scale Apache with Nginx
Scale Apache with NginxScale Apache with Nginx
Scale Apache with Nginx
 
Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...
 
Developing High Performance and Scalable ColdFusion Applications Using Terrac...
Developing High Performance and Scalable ColdFusion Applications Using Terrac...Developing High Performance and Scalable ColdFusion Applications Using Terrac...
Developing High Performance and Scalable ColdFusion Applications Using Terrac...
 
Four Ways to Improve ASP .NET Performance and Scalability
 Four Ways to Improve ASP .NET Performance and Scalability Four Ways to Improve ASP .NET Performance and Scalability
Four Ways to Improve ASP .NET Performance and Scalability
 
Caching By Nyros Developer
Caching By Nyros DeveloperCaching By Nyros Developer
Caching By Nyros Developer
 
your browser, my storage
your browser, my storageyour browser, my storage
your browser, my storage
 
Tips and Tricks For Faster Asp.NET and MVC Applications
Tips and Tricks For Faster Asp.NET and MVC ApplicationsTips and Tricks For Faster Asp.NET and MVC Applications
Tips and Tricks For Faster Asp.NET and MVC Applications
 
Ror caching
Ror cachingRor caching
Ror caching
 
Apache Traffic Server
Apache Traffic ServerApache Traffic Server
Apache Traffic Server
 
Academy PRO: HTML5 Data storage
Academy PRO: HTML5 Data storageAcademy PRO: HTML5 Data storage
Academy PRO: HTML5 Data storage
 

Mehr von Guo Albert

AWS IAM (Identity and Access Management) Policy Simulator
AWS IAM (Identity and Access Management) Policy SimulatorAWS IAM (Identity and Access Management) Policy Simulator
AWS IAM (Identity and Access Management) Policy SimulatorGuo Albert
 
TOEIC 準備心得
TOEIC 準備心得TOEIC 準備心得
TOEIC 準備心得Guo Albert
 
DBM專案環境建置
DBM專案環境建置DBM專案環境建置
DBM專案環境建置Guo Albert
 
JPA Optimistic Locking With @Version
JPA Optimistic Locking With @VersionJPA Optimistic Locking With @Version
JPA Optimistic Locking With @VersionGuo Albert
 
OCEJPA Study Notes
OCEJPA Study NotesOCEJPA Study Notes
OCEJPA Study NotesGuo Albert
 
OCEJPA(1Z0-898) Preparation Tips
OCEJPA(1Z0-898) Preparation TipsOCEJPA(1Z0-898) Preparation Tips
OCEJPA(1Z0-898) Preparation TipsGuo Albert
 
JPA lifecycle events practice
JPA lifecycle events practiceJPA lifecycle events practice
JPA lifecycle events practiceGuo Albert
 
XDate - a modern java-script date library
XDate -  a modern java-script date libraryXDate -  a modern java-script date library
XDate - a modern java-script date libraryGuo Albert
 
How to avoid check style errors
How to avoid check style errorsHow to avoid check style errors
How to avoid check style errorsGuo Albert
 
NIG系統報表開發指南
NIG系統報表開發指南NIG系統報表開發指南
NIG系統報表開發指南Guo Albert
 
Ease Your Effort of Putting Data into History Table
Ease Your Effort of Putting Data into History TableEase Your Effort of Putting Data into History Table
Ease Your Effort of Putting Data into History TableGuo Albert
 
NIG 系統開發指引
NIG 系統開發指引NIG 系統開發指引
NIG 系統開發指引Guo Albert
 
NIG系統開發文件閱讀步驟
NIG系統開發文件閱讀步驟NIG系統開發文件閱讀步驟
NIG系統開發文件閱讀步驟Guo Albert
 
Form Bean Creation Process for NIG System
Form Bean Creation Process for NIG SystemForm Bean Creation Process for NIG System
Form Bean Creation Process for NIG SystemGuo Albert
 
A Short Intorduction to JasperReports
A Short Intorduction to JasperReportsA Short Intorduction to JasperReports
A Short Intorduction to JasperReportsGuo Albert
 
Apply Template Method Pattern in Report Implementation
Apply Template Method Pattern in Report ImplementationApply Template Method Pattern in Report Implementation
Apply Template Method Pattern in Report ImplementationGuo Albert
 
Utilize Commons BeansUtils to do copy object
Utilize Commons BeansUtils to do copy objectUtilize Commons BeansUtils to do copy object
Utilize Commons BeansUtils to do copy objectGuo Albert
 
Apply my eclipse to do entity class generation
Apply my eclipse to do entity class generationApply my eclipse to do entity class generation
Apply my eclipse to do entity class generationGuo Albert
 
Nig project setup quickly tutorial
Nig project setup quickly tutorialNig project setup quickly tutorial
Nig project setup quickly tutorialGuo Albert
 
Spring JDBCTemplate
Spring JDBCTemplateSpring JDBCTemplate
Spring JDBCTemplateGuo Albert
 

Mehr von Guo Albert (20)

AWS IAM (Identity and Access Management) Policy Simulator
AWS IAM (Identity and Access Management) Policy SimulatorAWS IAM (Identity and Access Management) Policy Simulator
AWS IAM (Identity and Access Management) Policy Simulator
 
TOEIC 準備心得
TOEIC 準備心得TOEIC 準備心得
TOEIC 準備心得
 
DBM專案環境建置
DBM專案環境建置DBM專案環境建置
DBM專案環境建置
 
JPA Optimistic Locking With @Version
JPA Optimistic Locking With @VersionJPA Optimistic Locking With @Version
JPA Optimistic Locking With @Version
 
OCEJPA Study Notes
OCEJPA Study NotesOCEJPA Study Notes
OCEJPA Study Notes
 
OCEJPA(1Z0-898) Preparation Tips
OCEJPA(1Z0-898) Preparation TipsOCEJPA(1Z0-898) Preparation Tips
OCEJPA(1Z0-898) Preparation Tips
 
JPA lifecycle events practice
JPA lifecycle events practiceJPA lifecycle events practice
JPA lifecycle events practice
 
XDate - a modern java-script date library
XDate -  a modern java-script date libraryXDate -  a modern java-script date library
XDate - a modern java-script date library
 
How to avoid check style errors
How to avoid check style errorsHow to avoid check style errors
How to avoid check style errors
 
NIG系統報表開發指南
NIG系統報表開發指南NIG系統報表開發指南
NIG系統報表開發指南
 
Ease Your Effort of Putting Data into History Table
Ease Your Effort of Putting Data into History TableEase Your Effort of Putting Data into History Table
Ease Your Effort of Putting Data into History Table
 
NIG 系統開發指引
NIG 系統開發指引NIG 系統開發指引
NIG 系統開發指引
 
NIG系統開發文件閱讀步驟
NIG系統開發文件閱讀步驟NIG系統開發文件閱讀步驟
NIG系統開發文件閱讀步驟
 
Form Bean Creation Process for NIG System
Form Bean Creation Process for NIG SystemForm Bean Creation Process for NIG System
Form Bean Creation Process for NIG System
 
A Short Intorduction to JasperReports
A Short Intorduction to JasperReportsA Short Intorduction to JasperReports
A Short Intorduction to JasperReports
 
Apply Template Method Pattern in Report Implementation
Apply Template Method Pattern in Report ImplementationApply Template Method Pattern in Report Implementation
Apply Template Method Pattern in Report Implementation
 
Utilize Commons BeansUtils to do copy object
Utilize Commons BeansUtils to do copy objectUtilize Commons BeansUtils to do copy object
Utilize Commons BeansUtils to do copy object
 
Apply my eclipse to do entity class generation
Apply my eclipse to do entity class generationApply my eclipse to do entity class generation
Apply my eclipse to do entity class generation
 
Nig project setup quickly tutorial
Nig project setup quickly tutorialNig project setup quickly tutorial
Nig project setup quickly tutorial
 
Spring JDBCTemplate
Spring JDBCTemplateSpring JDBCTemplate
Spring JDBCTemplate
 

Kürzlich hochgeladen

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 

Kürzlich hochgeladen (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

nHibernate Caching

  • 2. Database Transaction nHibernate Caching nHibernate Caching Implementation Reference 2 Agenda
  • 8. Used for optimizing database applications. A cache is designed to reduce traffic between your application and the database by conserving data already loaded from the database. Database access is necessary only when retrieving data that is not currently available in the cache. The application may need to empty (invalidate) the cache from time to time if the database is updated or modified in some way, because it has no way of knowing whether the cache is up to date What is caching? 8
  • 9. nHibernate Cache Persistence context cache Pluggable, scope is process or cluster 9
  • 10. Two different Caches First-level cache Second-level cache associated with the Session object Hibernate uses first-level cache on a per transaction basis (within a single transaction boundary) Used mainly to reduce the number of SQL queries it needs to generate within a given transaction. For example, if an object is modified several times within the same transaction, Hibernate will generate only one SQL UPDATE statement at the end of the transaction, containing all the modifications associated with the SessionFactory object Second-level cache keeps loaded objects at the Session Factory level across transaction boundaries The objects in the second-level cache are available to the whole application, not just to the user running the query This way, each time a query returns an object that is already loaded in the cache, one or more database transactions potentially are avoided. 10
  • 11. Use it when you need to cache actual query results, rather than just persistent objects Query-level Cache 11
  • 14. 14 Cache Providers You can choose one of provider to use
  • 15. How to configure? Prevalence SysCache 15
  • 16. How to configure? Prevalence SysCache 16 Add four properties into <session-factory> <!-- nHibernate Cache configuration --> <property name="cache.provider_class">NHibernate.Caches.Prevalence.PrevalenceCacheProvider, NHibernate.Caches.Prevalence</property> <property name="cache.use_query_cache">true</property> <property name="cache.use_second_level_cache">true</property> <property name="cache.default_expiration">120</property> Add four properties into <session-factory> <!-- nHibernate Cache configuration --> <property name="cache.provider_class">NHibernate.Caches.SysCache.SysCacheProvider,NHibernate.Caches.SysCache</property> <property name="cache.use_query_cache">true</property> <property name="cache.use_second_level_cache">true</property> <property name="cache.default_expiration">120</property>
  • 17. How to configure ? – cont. 17
  • 18. 18 How to configure ? – cont.
  • 19. How to configure ? – cont. Configure caching strategy for each mapping file 19
  • 20. read only If your application needs to read but never modify instances of a persistent class, a read-only cache may be used. This is the simplest and best performing strategy. read/write If the application needs to update data, a read-write cache might be appropriate. This cache strategy should never be used if serializable transaction isolation level is required. nonstrict read/write If the application only occasionally needs to update data and strict transaction isolation is not required, a nonstrict-read-write cache might be appropriate. Cache StrategieCache Strategies (for Second-Level) 20
  • 21. 21 Run Search Function
  • 22. 2009-10-01 16:36:49,250 INFO NHibernate.Cfg.SettingsFactory.CreateCacheProvider(:0) - cache provider: NHibernate.Caches.Prevalence.PrevalenceCacheProvider, NHibernate.Caches.Prevalence 2009-10-01 16:36:49,250 INFO NHibernate.Cfg.SettingsFactory.BuildSettings(:0) - query cache factory: NHibernate.Cache.StandardQueryCacheFactory 2009-10-01 16:36:49,578 DEBUG NHibernate.Cache.CacheFactory.CreateCache(:0) - cache for: HelloNHibernate.vo.Contact usage strategy: read-write 2009-10-01 16:36:49,750 DEBUG NHibernate.Cache.CacheFactory.CreateCache(:0) - cache for: HelloNHibernate.vo.People usage strategy: read-write 2009-10-01 16:36:50,125 DEBUG NHibernate.Loader.Loader.InitializeEntitiesAndCollections(:0) - total objects hydrated: 3 2009-10-01 16:36:50,125 DEBUG NHibernate.Engine.TwoPhaseLoad.InitializeEntity(:0) - resolving associations for [HelloNHibernate.vo.People#3] 2009-10-01 16:36:50,140 DEBUG NHibernate.Engine.Loading.LoadContexts.LocateLoadingCollection(:0) - creating collection wrapper:[HelloNHibernate.vo.People.Contacts#3] 2009-10-01 16:36:50,140 DEBUG NHibernate.Engine.TwoPhaseLoad.InitializeEntity(:0) - adding entity to second-level cache: [HelloNHibernate.vo.People#3] 2009-10-01 16:36:50,140 DEBUG NHibernate.Cache.ReadWriteCache.Put(:0) - Caching: HelloNHibernate.vo.People#3 2009-10-01 16:36:50,140 DEBUG NHibernate.Caches.Prevalence.PrevalenceCache.Get(:0) - Fetching object 'NHibernate-Cache:HelloNHibernate.vo.People:HelloNHibernate.vo.People#3@3' from the cache. 2009-10-01 16:36:50,156 DEBUG NHibernate.Cache.ReadWriteCache.Put(:0) - Item was already cached: HelloNHibernate.vo.People#3 22 Check log – Prevalence Set cache provider Cache strategy Fetch data from cache
  • 23. 2009-10-19 13:21:27,046 DEBUG NHibernate.Cache.ReadWriteCache.Get(:0) - Cache lookup: Persistence.vo.CaseState#0 2009-10-19 13:21:27,046 DEBUG NHibernate.Caches.SysCache.SysCache.Get(:0) - Fetching object 'NHibernate-Cache:Persistence.vo.CaseState:Persistence.vo.CaseState#0@0' from the cache. 2009-10-19 13:21:27,046 DEBUG NHibernate.Cache.ReadWriteCache.Get(:0) - Cache hit: Persistence.vo.CaseState#0 2009-10-19 13:21:27,046 DEBUG NHibernate.Event.Default.DefaultLoadEventListener.AssembleCacheEntry(:0) - assembling entity from second-level cache: [Persistence.vo.CaseState#0] 2009-10-19 13:21:27,046 DEBUG NHibernate.Event.Default.DefaultLoadEventListener.AssembleCacheEntry(:0) - Cached Version: 2009-10-19 13:21:27,046 DEBUG NHibernate.Event.Default.DefaultLoadEventListener.DoLoad(:0) - resolved object in second-level cache: [Persistence.vo.CaseState#0] 2009-10-19 13:21:27,046 DEBUG NHibernate.Engine.TwoPhaseLoad.InitializeEntity(:0) - adding entity to second-level cache: [Persistence.vo.Cases#200910090114] 2009-10-19 13:21:27,046 DEBUG NHibernate.Cache.ReadWriteCache.Put(:0) - Caching: Persistence.vo.Cases#200910090114 2009-10-19 13:21:27,046 DEBUG NHibernate.Caches.SysCache.SysCache.Get(:0) - Fetching object 'NHibernate-Cache:Persistence.vo.Cases:Persistence.vo.Cases#200910090114@-909291618' from the cache. 2009-10-19 13:21:27,046 DEBUG NHibernate.Cache.ReadWriteCache.Put(:0) - Item was already cached: Persistence.vo.Cases#200910090114 23 Check log – SysCache
  • 24. nHibernate in Action, Manning, 2009/2 http://www.manning.com/kuate/ nHibernate online doc: Chapter 14. Improving performance https://www.hibernate.org/hib_docs/nhibernate/html/performance.html nHibernate online doc: Chapter 20. NHibernate.Caches https://www.hibernate.org/hib_docs/nhibernate/html/caches.html NHibernate考察系列 06 进阶篇 http://www.cnblogs.com/riccc/archive/2007/04/17/nhibernate-entity-lifecycle-secondary-cache-interceptor.html NHibernate之旅(22):探索NHibernate一级缓存 http://www.cnblogs.com/lyj/archive/2008/11/24/1340253.html 24 Reference