public void createSpringApp(String name) { JdbcConfig jdbc = buildJdbcProperties(rootContext, name); DataSource dataSource = null; if (rootContext.containsBean(name + "dataSource")) dataSource = (DataSource) rootContext.getBean(name + "dataSource"); SessionFactory sessionFactory = buildSession(name, config, dataSource, jdbc); beanFactory.registerSingleton(name + "SessionFactory", sessionFactory); beanFactory.registerSingleton( name + "HibernateTransactionManager", buildTransactionManager(name, config, dataSource, jdbc)); }