Options for using Spring, Hibernate, JPA, and Tomcat with multiple Databases
问题 I have a java web app running under Spring 2.5.6, Hibernate 3.4 (with Hibernate as the JPA provider), and Tomcat 6. I have it working with one DB schema / persistence unit but now need to connect to 2 schemas / persistence units. Can I do this without moving to a J2EE container such as JBoss or Glassfish? Will I need to use something like JOTM and global / XA transactions? 回答1: If you need to access multiple transactional resources within the same transaction, you'll need JTA and thus a JTA