use of org.apache.geronimo.connector.outbound.connectionmanagerconfig.TransactionSupport in project tomee by apache.
the class GeronimoConnectionManagerFactory method create.
public GenericConnectionManager create() {
final PoolingSupport poolingSupport = createPoolingSupport();
ClassLoader classLoader = this.classLoader;
if (classLoader == null) {
Thread.currentThread().getContextClassLoader();
}
if (classLoader == null) {
classLoader = getClass().getClassLoader();
}
if (classLoader == null) {
classLoader = ClassLoader.getSystemClassLoader();
}
final TransactionSupport txSupport = createTransactionSupport();
final RecoverableTransactionManager tm;
if (transactionManager instanceof RecoverableTransactionManager) {
tm = (RecoverableTransactionManager) transactionManager;
} else {
if (txSupport.isRecoverable()) {
throw new OpenEJBRuntimeException("currently recoverable tx support (xa) needs a geronimo tx manager");
}
tm = new SimpleRecoverableTransactionManager(transactionManager, name);
}
final GenericConnectionManager mgr;
if (validationIntervalMs >= 0 && mcf instanceof ValidatingManagedConnectionFactory) {
if (name == null) {
name = getClass().getSimpleName();
}
mgr = new ValidatingGenericConnectionManager(txSupport, poolingSupport, null, new AutoConnectionTracker(), tm, mcf, name, classLoader, validationIntervalMs);
} else {
mgr = new GenericConnectionManager(txSupport, poolingSupport, null, new AutoConnectionTracker(), tm, mcf, name, classLoader);
}
return mgr;
}
Aggregations