PoolableConnectionFactory factory = new PoolableConnectionFactory(connectionFactory,
this.pool, null, hasValQuery ? validationQuery : null, false, true,
defaultTransactionIsolation, abandonedConfig);
this.pool.setFactory(factory);
PoolingDataSource dataSource;
if (dataService.isEnableXA()) {
/* for XA-transactions */
dataSource = new ManagedDataSource(this.pool,
((XAConnectionFactory) connectionFactory).getTransactionRegistry());
} else {
dataSource = new PoolingDataSource(this.pool);
}
dataSource.setAccessToUnderlyingConnectionAllowed(true);
return dataSource;
}