return new ManagedDataSource(DataSource.class.cast(ds), transactionManager);
}
@Override
public DataSource poolManagedWithRecovery(final String name, final XAResourceWrapper xaResourceWrapper, final String driver, final Properties properties) {
final TransactionManager transactionManager = new TransactionManagerWrapper(OpenEJB.getTransactionManager(), name, xaResourceWrapper);
final CommonDataSource ds = pool(name, driver, properties);
if (ds instanceof XADataSource) {
return new ManagedXADataSource(ds, transactionManager);
}
return new ManagedDataSource(DataSource.class.cast(ds), transactionManager);