Zero enlisted resource log statements

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Zero enlisted resource log statements

djkrite
This post has NOT been accepted by the mailing list yet.
I'm using Tomcat 8, Hikari, Bitronix, Hibernate, and Spring. I have a working application that uses Tomcat's "Resource" feature to create a pooled datasource connection to MySql, via: com.zaxxer.hikari.HikariJNDIFactory

The app reference the JNDI datasource in the spring configuration, the datasource is then referenced in LocalContainerEntityManagerFactoryBean and as well in persistence.xml. TransactionManagerServices is used to setup the PlatformTransactionManager.

Here's persistence.xml file:

<?xml version="1.0" encoding="utf-8"?>
<persistence version="1.0"
        xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
       
                <persistence-unit name="appPersistenceUnit" transaction-type="JTA">
                <provider>org.hibernate.ejb.HibernatePersistence</provider>
                <jta-data-source>jdbc/AppDB</jta-data-source>
                <properties>
                        <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLInnoDBDialect" />
                        <property name="hibernate.show_sql" value="false" />
                        <property name="hibernate.format_sql" value="true" />
                        <property name="hibernate.hbm2ddl.auto" value="none" />
                        <property name="hibernate.default_batch_fetch_size" value="16" />
                        <property name="hibernate.enable_lazy_load_no_trans" value="true" />
                        <property name="hibernate.jndi.class" value="bitronix.tm.jndi.BitronixInitialContextFactory"/>
                        <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.BTMTransactionManagerLookup"/>
                        <property name="hibernate.hikari.dataSourceClassName" value="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" />
                        <property name="hibernate.cache.use_query_cache" value="false" />
                        <property name="hibernate.cache.use_second_level_cache" value="true" />
                </properties>
        </persistence-unit>
</persistence>

Here's the relevant spring config:

<jee:jndi-lookup id="appDbDataSource" jndi-name="jdbc/AppDB" resource-ref="true" />

        <bean id="appDbEntityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
                <property name="dataSource" ref="appDbDataSource" />
                <property name="persistenceXmlLocation" value="classpath:persistence.xml" />
                <property name="persistenceUnitName" value="appPersistenceUnit" />
                <property name="jpaVendorAdapter">
                        <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
                                <property name="showSql" value="false" />
                        </bean>
                </property>
            </bean>

        <bean id="bitronixTransactionManager" factory-method="getTransactionManager" depends-on="appDbDataSource,jtaTransactionManager"
        class="bitronix.tm.TransactionManagerServices" destroy-method="shutdown" />

    <bean id="jtaTransactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
        <property name="transactionManager" ref="bitronixTransactionManager" />
        <property name="userTransaction" ref="bitronixTransactionManager" />
    </bean>

    <tx:annotation-driven transaction-manager="jtaTransactionManager" />

Is something not configured correctly here? Why am I getting the zero enlisted resources log statements?

Thank you,

tom
Loading...