Example usage for javax.persistence.spi PersistenceUnitInfo getJtaDataSource

List of usage examples for javax.persistence.spi PersistenceUnitInfo getJtaDataSource

Introduction

In this page you can find the example usage for javax.persistence.spi PersistenceUnitInfo getJtaDataSource.

Prototype

public DataSource getJtaDataSource();

Source Link

Document

Returns the JTA-enabled data source to be used by the persistence provider.

Usage

From source file:org.kuali.rice.krad.data.jpa.eclipselink.KradEclipseLinkEntityManagerFactoryBeanTest.java

private boolean isJtaEnabled() throws Exception {
    EntityManagerFactoryDelegate delegate = entityManagerFactory.unwrap(EntityManagerFactoryDelegate.class);
    PersistenceUnitInfo info = delegate.getSetupImpl().getPersistenceUnitInfo();
    return info.getJtaDataSource() != null && info.getTransactionType() == PersistenceUnitTransactionType.JTA;
}