5.2.3. Default Hibernate Options

Hibernate has many configuration properties. JBoss Enterprise Application Platform uses default values for the properties that you do not specify in the persistence.xml file. The default Hibernate property values are specified in the PersistenceUnitDeployer bean definition in the JBOSS_HOME/server/PROFILE/deployers/ejb3.deployer/META-INF/jpa-deployers-jboss-beans.xml file. Below is the code of the bean used in JBoss Enterprise Application Platform 5. Notice the options that are commented out. These are the properties available in the persistence.xml file.

<bean name="PersistenceUnitDeployer" class="org.jboss.jpa.deployers.PersistenceUnitDeployer">
   <property name="defaultPersistenceProperties">
	  <map keyClass="java.lang.String" valueClass="java.lang.String">
		 <entry>
			<key>hibernate.transaction.manager_lookup_class</key>
<value>org.hibernate.transaction.JBossTransactionManagerLookup</value>
		 </entry>
		 <!--entry>
			<key>hibernate.connection.release_mode</key>
			<value>after_statement</value>
		 </entry-->
		 <!--entry>
			<key>hibernate.transaction.flush_before_completion</key>
			<value>false</value>
		 </entry-->
		 <!--entry>
			<key>hibernate.transaction.auto_close_session</key>
			<value>false</value>
		 </entry-->
		 <!--entry>
			<key>hibernate.query.factory_class</key>
			<value>org.hibernate.hql.ast.ASTQueryTranslatorFactory</value>
		 </entry-->
		 <!--entry>
			<key>hibernate.hbm2ddl.auto</key>
			<value>create-drop</value>
		 </entry-->
		 <entry>
			<key>hibernate.cache.provider_class</key>
			<value>org.hibernate.cache.HashtableCacheProvider</value>
		 </entry>
		 <!-- Clustered cache with JBoss Cache -->
		 <!--entry>
			<key>hibernate.cache.region.factory_class</key>
<value>org.hibernate.cache.jbc2.JndiMultiplexedJBossCacheRegionFactory</value>
		 </entry>
		 <entry>
			<key>hibernate.cache.region.jbc2.cachefactory</key>
			<value>java:CacheManager</value>
		 </entry>
		 <entry>
			<key>hibernate.cache.region.jbc2.cfg.entity</key>
			<value>pessimistic-entity</value>
		 </entry>
		 <entry>
			<key>hibernate.cache.region.jbc2.cfg.query</key>
			<value>local-query</value>
		 </entry-->
		 <!--entry>
			<key>hibernate.dialect</key>
			<value>org.hibernate.dialect.HSQLDialect</value>
		 </entry-->
		 <entry>
			<key>hibernate.jndi.java.naming.factory.initial</key>
			<value>org.jnp.interfaces.NamingContextFactory</value>
		 </entry>
		 <entry>
			<key>hibernate.jndi.java.naming.factory.url.pkgs</key>
			<value>org.jboss.naming:org.jnp.interfaces</value>
		 </entry>
		 <entry>
			<key>hibernate.bytecode.use_reflection_optimizer</key>
			<value>false</value>
		 </entry>
		 <entry>
			<key>hibernate.bytecode.provider</key>
			<value>javassist</value>
		 </entry>
	  </map>
   </property>
</bean>