Yaa I need to know how to implement this singleton pattern.See I have to migrate From Hibernate to NHibernate so in Hbernate project they are using a session factory just like shown below.
Code:
<hibernate-configuration>
<session-factory>
<!--
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@171.186.252.121:1527:SBCD</property>
<property name="hibernate.connection.username">appl_sbcs</property>
<property name="hibernate.connection.password">sbcsg2</property>
-->
<property name="connection.datasource">sbcsdatasource</property>
<!-- <property name="connection.datasource">sbcsr2datasource</property> -->
<property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="jta.UserTransaction">java:comp/UserTransaction</property>
<property name="hibernate.jndi.class">weblogic.jndi.WLInitialContextFactory</property>
<property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="hibernate.show_sql">false</property>
<property name="use_outer_join">true</property>
<property name="transaction.factory_class">
org.hibernate.transaction.JDBCTransactionFactory
</property>
<!-- mapping file for customerinfo view-->
<mapping resource="customerInfo.hbm.xml"/>
<!--mapping file for affiliate associated with customers-->
<mapping resource="Affiliate.hbm.xml"/>
<!--mapping file for guarantor sassociated with customers-->
<mapping resource="Guarantor.hbm.xml"/>
<!--mapping file for loaninfo view -->
<mapping resource="LoanInfoView.hbm.xml"/>
so Need to implement session factory in NHibernate so that I just have to Load this hbm.xml file and not hte other files...