} else {
try {
TransactionSynchronizationRegistry transactionSynchronizationRegistry = (TransactionSynchronizationRegistry) syncController.getValue();
TransactionManager transactionManager = (TransactionManager)managerController.getValue();
ProxyFactory<?> proxyFactory = new ProxyFactory(clazz);
object = proxyFactory.newInstance(new DataSourceTransactionProxyHandler(object, transactionManager, transactionSynchronizationRegistry));
} catch (Exception e) {
logger.warn("Transactional datasource " + className + " could not be proxied and will not be enlisted in transactions automatically", e);
}
}
}