Example usage for org.springframework.boot.orm.jpa.hibernate SpringJtaPlatform SpringJtaPlatform

List of usage examples for org.springframework.boot.orm.jpa.hibernate SpringJtaPlatform SpringJtaPlatform

Introduction

In this page you can find the example usage for org.springframework.boot.orm.jpa.hibernate SpringJtaPlatform SpringJtaPlatform.

Prototype

public SpringJtaPlatform(JtaTransactionManager transactionManager) 

Source Link

Usage

From source file:org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration.java

private void configureSpringJtaPlatform(Map<String, Object> vendorProperties,
        JtaTransactionManager jtaTransactionManager) {
    try {//from   ww w. ja v a  2s . com
        vendorProperties.put(JTA_PLATFORM, new SpringJtaPlatform(jtaTransactionManager));
    } catch (LinkageError ex) {
        // NoClassDefFoundError can happen if Hibernate 4.2 is used and some
        // containers (e.g. JBoss EAP 6) wraps it in the superclass LinkageError
        if (!isUsingJndi()) {
            throw new IllegalStateException("Unable to set Hibernate JTA "
                    + "platform, are you using the correct " + "version of Hibernate?", ex);
        }
        // Assume that Hibernate will use JNDI
        if (logger.isDebugEnabled()) {
            logger.debug("Unable to set Hibernate JTA platform : " + ex.getMessage());
        }
    }
}

From source file:org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaConfiguration.java

private void configureSpringJtaPlatform(Map<String, Object> vendorProperties,
        JtaTransactionManager jtaTransactionManager) {
    try {/*www .  ja  v a  2  s .co m*/
        vendorProperties.put(JTA_PLATFORM, new SpringJtaPlatform(jtaTransactionManager));
    } catch (LinkageError ex) {
        // NoClassDefFoundError can happen if Hibernate 4.2 is used and some
        // containers (e.g. JBoss EAP 6) wrap it in the superclass LinkageError
        if (!isUsingJndi()) {
            throw new IllegalStateException("Unable to set Hibernate JTA "
                    + "platform, are you using the correct " + "version of Hibernate?", ex);
        }
        // Assume that Hibernate will use JNDI
        if (logger.isDebugEnabled()) {
            logger.debug("Unable to set Hibernate JTA platform : " + ex.getMessage());
        }
    }
}