Multiple database with NHibernate
        Posted  
        
            by Flint
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Flint
        
        
        
        Published on 2010-04-16T17:05:33Z
        Indexed on 
            2010/04/16
            17:23 UTC
        
        
        Read the original article
        Hit count: 433
        
Hi,
I have two databases. One from Oracle 10g. Another from Mysql. I have configured my web application with Nhibernate for Oracle and now I am in need of using the MySQL database. So how can i configure the hibernate.cfg.xml so that i can use both of the database at the same application?
My current hibernate.cfg.xml is:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
  <session-factory>
    <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
    <property name="connection.driver_class">NHibernate.Driver.OracleClientDriver</property>
    <property name="connection.connection_string">Data Source=xe;Persist Security Info=True;User ID=hr;Password=hr;Unicode=True</property>
    <property name="show_sql">false</property>
    <property name="dialect">NHibernate.Dialect.Oracle9Dialect</property>
    <!-- mapping files -->
    <mapping assembly="DataTransfer" />
  </session-factory>
</hibernate-configuration> 
© Stack Overflow or respective owner