A concurrency strategy is a mediator which responsible for storing items of data in the cache and retrieving them from the cache. If you are going to enable a second-level cache, you will have to decide, for each persistent class and collection, which cache concurrency strategy to use.
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> <hibernate-mapping> <classname="Employee"table="EMPLOYEE"> <metaattribute="class-description"> This class contains the employee detail. </meta> <cacheusage="read-write"/> <idname="id"type="int"column="id"> <generatorclass="native"/> </id> <propertyname="firstName"column="first_name"type="string"/> <propertyname="lastName"column="last_name"type="string"/> <propertyname="salary"column="salary"type="int"/> </class> </hibernate-mapping> The usage="read-write" attribute tells Hibernate to use a read-write concurrency strategy for the defined cache. |