DataSource « cfg « JPA Q&A

2. How to define 2 data source in hibernate.cfg.xml file?

Currently my project required me to retrieve data from one database, and manipulate(insert, delete, update) data to another database. How can i define 2 data source in hibernate.cfg.xml file? or any ways to do it? jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=EVENTS sa password 10 true org.hibernate.dialect.SQLServerDialect org.hibernate.transaction.JDBCTransactionFactory org.hibernate.cache.HashtableCacheProvider ...

3. configuring multiple datasources in single hibernate.cfg.xml

I've configured multiple datasources in Application Server say 'JBoss'. Then how can we configure/use all these datasources in a [b]SINGLE[/b] hibernate configuration file, so that when we obtain a session factory based on that single configuration file, it could be used to execute distributed transaction across all configured datasources... Thanks in advance..

4. Datasource name in Hibernate.cfg.xml