org.hibernate.cache.access

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Natural Language Processing
51.Net
52.Parser
53.PDF
54.Portal
55.Profiler
56.Project Management
57.Report
58.RSS RDF
59.Rule Engine
60.Science
61.Scripting
62.Search Engine
63.Security
64.Sevlet Container
65.Source Control
66.Swing Library
67.Template Engine
68.Test Coverage
69.Testing
70.UML
71.Web Crawler
72.Web Framework
73.Web Mail
74.Web Server
75.Web Services
76.Web Services apache cxf 2.2.6
77.Web Services AXIS2
78.Wiki Engine
79.Workflow Engines
80.XML
81.XML UI
Java Source Code / Java Documentation  » Database ORM » hibernate » org.hibernate.cache.access 
org.hibernate.cache.access

Defines contracts for transactional and concurrent access to cached {@link org.hibernate.cache.access.EntityRegionAccessStrategy entity} and {@link org.hibernate.cache.access.CollectionRegionAccessStrategy collection} data. Transactions pass in a timestamp indicating transaction start time which is then used to protect against concurrent access (exactly how that occurs is based on the actual access-strategy impl used). Two different implementation patterns are provided for.

  • A transaction-aware cache implementation might be wrapped by a synchronous access strategy, where updates to the cache are written to the cache inside the transaction.
  • A non-transaction-aware cache would be wrapped by an asynchronous access strategy, where items are merely "soft locked" during the transaction and then updated during the "after transaction completion" phase; the soft lock is not an actual lock on the database row - only upon the cached representation of the item.
The asynchronous access strategies are: {@link org.hibernate.cache.access.AccessType.READ_ONLY read-only}, {@link org.hibernate.cache.access.AccessType.READ_WRITE read-write} and {@link org.hibernate.cache.access.AccessType.NONSTRICT_READ_WRITE nonstrict-read-write}. The only synchronous access strategy is {@link org.hibernate.cache.access.AccessType.TRANSACTIONAL transactional}.

Note that, for an asynchronous cache, cache invalidation must be a two step process (lock->unlock or lock->afterUpdate), since this is the only way to guarantee consistency with the database for a nontransactional cache implementation. For a synchronous cache, cache invalidation is a single step process (evict or update). Hence, these contracts ({@link org.hibernate.cache.access.EntityRegionAcessStrategy} and {@link org.hibernate.cache.access.CollectionRegionAccessStrategy}) define a three step process to cater for both models (see the individual contracts for details).

Note that query result caching does not go through an access strategy; those caches are managed directly against the underlying {@link org.hibernate.cache.QueryResultsRegion}.

Java Source File NameTypeComment
AccessType.javaClass The types of access strategies available.
CollectionRegionAccessStrategy.javaInterface Contract for managing transactional and concurrent access to cached collection data.
EntityRegionAccessStrategy.javaInterface Contract for managing transactional and concurrent access to cached entity data.
SoftLock.javaInterface Moved up from inner definition on the now deprecated org.hibernate.cache.CacheConcurrencyStrategy .
w__w___w_._jav___a_2__s__.__c__o_m__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.