Configuration jthinkConfig = (Configuration)resManager.getResource(WEBApplicationContext.class.getName(), Configuration.class.getName());
if(resManager.getResource(TransactionManager.class.getName())==null){
/* 设置资源, 初始化事务管理器, 将TransactionManager加入到ResourceManager中 */
logger.debug("初始化事务管理器, TransactionManager.");
TransactionManager transactionManager = new DefaultTransactionManager(resManager, jthinkConfig);
resManager.setResource(TransactionManager.class.getName(), transactionManager);
// 加入WEB端事务到事务管理器
logger.debug("初始化Web端事务, WebTransaction.");
TransactionFactory transactionFactory = transactionManager.getTransactionFactory("WebTransaction");
JDBCTransaction transaction = (JDBCTransaction)transactionFactory.create();
transactionManager.addTransaction(JDBCTransaction.class.getName(), transaction);
}
return resManager;
}