These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Connecting to Oracle using NHibernate
PostPosted: Thu Feb 28, 2008 12:59 pm 
Newbie

Joined: Thu Nov 22, 2007 11:43 am
Posts: 8
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Full stack trace of any exception that occurs:
SpringNba.IntegrationTests.OracleIntegrationTestNoDbUnit (TestFixtureSetUp):
Spring.Objects.Factory.ObjectCreationException : Error creating object with name 'NHibernateSessionFactory' defined in 'assembly [SpringNba, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null], resource [SpringNba.Config.oracle-db-provider-context.xml]' : Initialization of object failed : Could not create the driver from NHibernate.Driver.OracleDataClientDriver.
----> NHibernate.HibernateException : Could not create the driver from NHibernate.Driver.OracleDataClientDriver.
----> System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation.
----> NHibernate.HibernateException : The IDbCommand and IDbConnection implementation in the assembly Oracle.DataAccess could not be found. Ensure that the assembly Oracle.DataAccess is located in the application directory or in the Global Assembly Cache. If the assembly is in the GAC, use <qualifyAssembly/> element in the application configuration file to specify the full name of the assembly.
Name and version of the database you are using:
Oracle 10g
The generated SQL (show_sql=true):


hello all,
i am trying to use NHIbernate (via Spring.NET) connecting to an Oracle 10 g database.
here's my config data
Code:
<db:provider id="DbProvider"
                  provider="OracleODP-2.0"
                  connectionString="Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL)));User Id=scott;Password=tiger;"/>

 
  <object id="NHibernateSessionFactory" type="Spring.Data.NHibernate.LocalSessionFactoryObject, Spring.Data.NHibernate12">
    <property name="DbProvider" ref="DbProvider"/>
    <property name="MappingAssemblies">
      <list>
        <value>SpringNba</value>
      </list>
    </property>
    <property name="HibernateProperties">
      <dictionary>
        <entry key="hibernate.hbm2ddl.auto"
               value="update"/>

        <entry key="hibernate.connection.provider"
               value="NHibernate.Connection.DriverConnectionProvider"/>

        <entry key="hibernate.dialect"
               value="NHibernate.Dialect.OracleDialect"/>

        <entry key="hibernate.connection.driver_class"
               value="NHibernate.Driver.OracleDataClientDriver"/>

      </dictionary>
    </property>
  </object>


and i keep on getting exception reported in this message.

I can successfully connect to oracle using , as example, Spring AdoTemplate...
for some reasons, i keepo n getting exception that code cannot find Oracle.DataAccess..... but if it was so, i could not even run my other code not using NHibernate

has anyone found similar problems?i m running my tests usign NUnit 2.6..

anyone could help?

thanks and regars
marco


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 29, 2008 1:04 am 
Hibernate Team
Hibernate Team

Joined: Tue Jun 13, 2006 11:29 pm
Posts: 315
Location: Calgary, Alberta, Canada
Make sure the actual Oracle ADO.NET driver is in the bin folder.

_________________
Karl Chu


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.