<?xml version="1.0" encoding="UTF-8"?>
<!--
    author: Jens Pelzetter
-->

<persistence 
    xmlns="http://xmlns.jcp.org/xml/ns/persistence"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence 
                        http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"
    version="2.1">
    
    <persistence-unit name="LibreCCM" transaction-type="JTA">
        
        <!-- 
            Enforce JPA provider
            Not really necessary here because we don't use any Hibernate 
            specific features, but makes it easier to manage to database
            creation scripts.
        -->
        <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
            
        <jta-data-source>java:/comp/env/jdbc/org/libreccm/ccm-core/pgsql</jta-data-source>
        <properties>
            <property name="hibernate.hbm2ddl.auto" value=""/>
            <property name="hibernate.show_sql" value="true"/>
            <property name="hibernate.id.new_generator_mappings" value="true"/>
            <property name="hibernate.connection.autocommit" value="false" />
            
            <!-- 
                Properties for Hibernate Envers 
                We are using the ValidityAuditStrategy here because it is faster
                when querying data than the DefaultStrategy
            -->
            <!--<property name="org.hibernate.envers.audit_strategy" 
                      value="org.hibernate.envers.strategy.ValidityAuditStrategy"/>-->
        </properties>
    </persistence-unit>
    
</persistence>