0

I have a Windows x64 installed on my machine, of course Oracle hadn't made a Driver for using their client in Oracle10g, this is seems to be a huge problem for me (stop whining)....

So i actually have to connect to DB with Direct Mode.

This is the way it works:

  OracleConnectionStringBuilder oraCsb = new OracleConnectionStringBuilder {
            Direct = true,
            Server = "xxx",
            Port = 1521,
            Sid = "xxx",
            UserId = "xxx",
            Password = "xxx"
        };
        OracleConnection myConnection = new OracleConnection(oraCsb.ConnectionString);
        myConnection.Open();

        const string myInsertQuery = "SELECT * FROM MEMBERS WHERE ID = 1";
        OracleCommand myCommand = new OracleCommand(myInsertQuery) { Connection = myConnection };
        myConnection.Open();

        try {
            var source = myCommand.ExecuteReader();
        } finally {
            myConnection.Close();
        }

Actually this way it's works.

But here is my problem how to Integrate it into FluentNHibernate?

How to use it in here?

     _configuration = Fluently.Configure().Database(OracleClientConfiguration.Oracle10   .ConnectionString(@"server=xxx;user id=xxx;password=xxx;SID=xxx;port=1521;Direct=True;")
 .UseReflectionOptimizer()
 .AdoNetBatchSize(5000)
 .ShowSql().FormatSql())

How to make it work without a OracleClient (for 10g)?

hackp0int
  • 4,052
  • 8
  • 59
  • 95

1 Answers1

0

The NHibernate runtime support and Direct Mode features are included in the Professional Edition of dotConnect for Oracle. There is an example of compiling NHibernate sources to add support for dotConnect provider: http://blogs.devart.com/dotconnect/nhibernate_and_oracle.html.

Also we recommend you to pay attention to Entity Developer for NHibernate (and Professional) which supports ADO.NET providers to create an NHibernate model and generate classes and mapping for them.

Devart
  • 119,203
  • 23
  • 166
  • 186
  • There is an example of how to use it in FluentNh? – hackp0int Jun 26 '13 at 18:23
  • I have 4.2.85 EF LinqConn I haven't purchased the NH ver how can you help me with that? – hackp0int Jun 27 '13 at 04:52
  • 1. There is a "Fluent NHibernate" template for NHibernate models in Entity Developer Professional (or NHibernate Edition): http://www.devart.com/entitydeveloper/entitydeveloper.chm (do Properties > Unblock if its content is blocked in your environment) > ORM Support > NHibernate > Generation > Model Generation Templates > Fluent NHibernate Template. – Devart Jul 03 '13 at 11:24
  • 2. Please refer to http://www.devart.com/entitydeveloper/ordering.html . If you have any questions about ordering the product, contact our Sales department: http://www.devart.com/company/contactform.html . – Devart Jul 03 '13 at 11:29