से चालक नहीं बना सका यहाँ कोड अपवाद को ऊपर उठाने के लिए:NHibernate.Driver.OracleDataClientDriver
public static class NHibernateSessionManager
{
private static ISessionFactory sessionFactory = new Configuration().Configure().BuildSessionFactory();
public static ISession GetSession(string clientId)
{
if (ContextSession == null)
ContextSession = sessionFactory.OpenSession(new OracleIntercerptor(clientId.ToUpper()));
else
((OracleConnection)ContextSession.Connection).ClientId = clientId;
return ContextSession;
}
// - snip -
}
और जहां अपवाद उठाया है कोड के लिए कॉल:
private ISession NHibernateSession
{
get
{
return NHibernateSessionManager.GetSession(SessionWrapper.GetUser());
}
}
मैं एक मिल TypeInitializationException
{ "type 'Sigaf.Presupuesto.EntidadesDAL.NHibernate.NHiberna के लिए प्रारंभकर्ता teSessionManager ' एक अपवाद। फेंक दिया NHibernate.Driver.OracleDataClientDriver से चालक नहीं बना सका। "}
एक"}
{की एक आंतरिक अपवाद के साथ " कुछ और आंतरिक अपवाद मुझे एनआरई में ले जाते हैं:
ऑब्जेक्ट संदर्भ नहीं है किसी ऑब्जेक्ट के उदाहरण के लिए।
NHibernate.Driver.OracleDataClientDriver..ctor()NHibernate v3.0 लक्ष्य फ्रेमवर्क v4.0 इस कोड कार्यान्वयन अन्य, समान, समाधान के लिए काम कर रहा है पर।
ओह, Hibernate.config फ़ाइल:
<?xml version="1.0"?> <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"> <session-factory> <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property> <property name="dialect">NHibernate.Dialect.Oracle10gDialect</property> <property name="current_session_context_class">web</property> <property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property> <property name="connection.driver_class">NHibernate.Driver.OracleDataClientDriver</property> <property name="connection.connection_string_name">Sigaf</property> <property name="default_schema">PRE</property> <property name="show_sql">true</property> <mapping assembly="Sigaf.Presupuesto.EntidadesDAL" /> </session-factory> </hibernate-configuration>
मैंने इसे अपने डेटा एक्सेस प्रोजेक्ट में किया लेकिन यह काम नहीं किया। एक बार मैंने इसे अपने आवेदन प्रोजेक्ट (एमवीसी 3) में किया था, यह काम करता था। – Alex
यह समझ में आता है, एक परियोजना केवल असेंबली लाएगी कि एक संदर्भ को संकलित करने की आवश्यकता है। इन प्रकार के संदर्भों के लिए, जो प्रतिबिंब/कॉन्फ़िगरेशन-केवल संदर्भ हैं, वे मेजबान प्रोजेक्ट में होना चाहिए। – Rich