Could not create the driver from NHibernate.Driver.OracleDataClientDriver

hayes_paul's Avatar

hayes_paul

20 Jul, 2010 10:59 AM via web

Hi,

Just to update, the previous error was a red-herring, i removed the Dialect("NHibernate.Dialect.Oracle9Dialect")
and now get the above error message which i have been getting for ages.

I am attempting to connect to oracle 10 with visual studio 2010, i am using the follwing method:

public static ISessionFactory CreateSessionFactory()

    {
        FluentConfiguration idk = Fluently
            .Configure()
            .Database(OracleDataClientConfiguration
                .Oracle10
                .Dialect("NHibernate.Dialect.Oracle9Dialect")
                .Driver("NHibernate.Driver.OracleDataClientDriver")
                .Provider("NHibernate.Connection.DriverConnectionProvider")
                .UseReflectionOptimizer()
                .MaxFetchDepth(3)
                .AdoNetBatchSize(500)
                .ConnectionString(cs => cs
                .Server("PAUL-PC")
                .Port(1521)
                .Instance("xe")
                .Username("xxx")
                .Password("xxx")
                .Pooling(true)
                .StatementCacheSize(100)
                .OtherOptions(
                "Min Pool Size=10;Incr Pool Size=5;Decr Pool Size=2;")
            )
            // It does this automatically.. but I like to be explicit ;)
            .ProxyFactoryFactory("NHibernate.ByteCode.Castle.ProxyFactoryFactory,NHibernate.ByteCode.Castle")
            .ShowSql()
            )

           //.Mappings(m => m.FluentMappings.Add(typeof(PortalUserMap)).ExportTo("c:"))
            .Mappings(m => m.FluentMappings.AddFromAssemblyOf<PortalUserMap>().ExportTo(@"c:\"));


        idk.ExposeConfiguration(BuildSchema);

        return idk.BuildSessionFactory();
    }

and my mapping file looks like this when exported.

<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-access="property" auto-import="true" default-cascade="none" default-lazy="true">

<id name="Id" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  <column name="ID" />
  <generator class="identity" />
</id>
<property name="UserName" type="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  <column name="USER_NAME" />
</property>

</hibernate-mapping>

the code for this is:

public PortalUserMap()

    {
        Table("PortalUser");

        Id(x => x.Id, "ID").GeneratedBy.Identity();
        Map(x => x.UserName, "USER_NAME");
    }

I had previoulsy been geting errors with the oracle driver until i added the following lines:

.Dialect("NHibernate.Dialect.Oracle9Dialect")

                .Driver("NHibernate.Driver.OracleDataClientDriver")
                .Provider("NHibernate.Connection.DriverConnectionProvider")

that seemed to solve the problem, but now i get the mapping issue.

any help would be good.

Paul.

  1. Support Staff 2 Posted by James Gregory on 22 Jul, 2010 11:03 AM

    James Gregory's Avatar

    What's the full exception you're getting? It normally includes some schema validation info.

Reply to this discussion

Preview Comments are parsed with Markdown. Help with syntax

Attached Files

    You can attach files up to 10MB

    What comes next? 'Monday Tuesday Wednesday ?????'