title: How to configure second level cache in Hibernate 4.3
body: <p>I have read post related with this but not get any answer working for me.
  I am configuring <code>second level cache</code> in <code>Hibernate v4.3.</code> And I have used <code>MySQL 5.0</code></p>
  
  <p>I have written following elements in <code>hibernate.cfg.xml</code></p>
  
  <pre><code>&lt;property name="hibernate.cache.use_second_level_cache"&gt;true&lt;/property&gt;
  &lt;property name="hibernate.cache.region.factory_class"&gt;org.hibernate.cache.ehcache.EhCacheRegionFactory&lt;/property&gt;
  </code></pre>
  
  <p>I have annotated my Entity class for cache as follows</p>
  
  <pre><code>@Entity 
  
  @Cache(usage = CacheConcurrencyStrategy.READ_ONLY)
  public class Employee { ....}
  </code></pre>
  
  <p>Following exception is shown when run</p>
  
  <blockquote>
  <pre><code>INFO: HHH000397: Using ASTQueryTranslatorFactory
  Exception in thread "main" org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.cache.spi.RegionFactory]
      at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:233)
      at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:197)
      at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:178)
      at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:295)
      at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2442)
      at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2438)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1855)
      at com.example.hibernate.Hibernate4Main.main(Hibernate4Main.java:32)
  Caused by: org.hibernate.HibernateException: could not instantiate RegionFactory [org.hibernate.cache.ehcache.EhCacheRegionFactory]
      at org.hibernate.cache.internal.RegionFactoryInitiator.initiateService(RegionFactoryInitiator.java:101)
      at org.hibernate.cache.internal.RegionFactoryInitiator.initiateService(RegionFactoryInitiator.java:46)
      at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:83)
      at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:223)
      ... 7 more
  Caused by: org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable to resolve name [org.hibernate.cache.ehcache.EhCacheRegionFactory] as strategy [org.hibernate.cache.spi.RegionFactory]
      at org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.selectStrategyImplementor(StrategySelectorImpl.java:128)
      at org.hibernate.cache.internal.RegionFactoryInitiator.initiateService(RegionFactoryInitiator.java:87)
      ... 10 more
  </code></pre>
  </blockquote>
  
  <p>I have seen than there are different cache providers for <code>Hibernate v3</code> like <code>EhCacheProvoider</code>. All are in <code>org.hibernate.cache</code> package.
  But for <code>Hibernate 4.3</code> there are only 3 classes as <code>RegionFactory.class</code> and other two are of <code>exception</code>.</p>
  
  <p><strong>1. What is wrong with above code?</strong></p>
  
  <p><strong>2. What are major changes made for Second level cache configuration in Hibernate 4.3?</strong></p>