Page 1 of 1
Using with NHibernate / Fluent NHibernate
Posted: Fri 28 Aug 2009 17:13
by ColinBo
Is anyone using dotConnect for Oracle with NHibernate and FluentNHibernate? How are you connecting to the driver? Using the latest GA bits I am hitting "ArgumentException:
Column 'ReservedWord' does not belong to table ReservedWords."
System.Data.DataRow.GetDataColumn(String columnName)
System.Data.DataRow.get_Item(String columnName)
NHibernate.Dialect.Schema.AbstractDataBaseSchema.GetReservedWords()
NHibernate.Tool.hbm2ddl.SchemaMetadataUpdater.GetReservedWords(Dialect
dialect, IConnectionHelper connectionHelper)
NHibernate.Tool.hbm2ddl.SchemaMetadataUpdater.Update(ISessionFactory
sessionFactory)
NHibernate.Impl.SessionFactoryImpl..ctor(Configuration cfg, IMapping
mapping, Settings settings, EventListeners listeners)
NHibernate.Cfg.Configuration.BuildSessionFactory()
FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() in c:
\Documents and Settings\Administrator\dev\fluent-nhibernate\src
\FluentNHibernate\Cfg\FluentConfiguration.cs: line 93
FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory() in c:
\Documents and Settings\Administrator\dev\fluent-nhibernate\src
\FluentNHibernate\Cfg\FluentConfiguration.cs: line 98
Posted: Mon 31 Aug 2009 06:09
by Shalex
Here are the steps for setting up dotConnect for Oracle to work with NHibernate.
1. Please put the DevartDataOracleDriver.cs file to the \NHibernate-x.x.x.GA-src\src\NHibernate\Driver\ folder, and recompile the NHibernate project. The DevartDataOracleDriver.cs content should be the following:
Code: Select all
using NHibernate.SqlTypes;
using System.Data;
namespace NHibernate.Driver
{
public class DevartDataOracleDriver : ReflectionBasedDriver
{
///
/// Initializes a new instance of the class.
///
///
/// Thrown when the Devart.Data.Oracle assembly can not be loaded.
///
public DevartDataOracleDriver()
: base(
"Devart.Data.Oracle",
"Devart.Data.Oracle.NHibernate.NHibernateOracleConnection",
"Devart.Data.Oracle.NHibernate.NHibernateOracleCommand")
{
}
///
public override bool UseNamedPrefixInSql {
get { return true; }
}
///
public override bool UseNamedPrefixInParameter {
get { return true; }
}
///
public override string NamedPrefix {
get { return ":"; }
}
}
}
2. The client application needs dotConnect for Oracle v 5.25.39 and above.
3. The section, which configures NHibernate in web.config, should be like:
Code: Select all
NHibernate.Dialect.Oracle9iDialect
NHibernate.Driver.DevartDataOracleDriver
User Id=scott;Password=tiger;Server=ORA
NHibernate.Connection.DriverConnectionProvider
NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu
We will make a tutorial or an article about using NHibernate with our providers in the nearest future.
As for the mentioned error, could you please send us a small test project with appropriate DDL/DML script to reproduce the problem in our environment?
Posted: Mon 31 Aug 2009 13:38
by ColinBo
Shalex wrote:As for the mentioned error, could you please send us a small test project with appropriate DDL/DML script to reproduce the problem in our environment?
Where should I send it to? I should note that I am using FluentNHibernate 1.0 RC with NHibernate 2.1. This has been noted as a problem with the
MySQL side as well.
Posted: Tue 01 Sep 2009 10:53
by Shalex
Please try the implementation with dotConnect for Oracle v 5.25.39 in the way we have mentioned in the post above. If the problem persists, please send us a test project via our contact form (
http://www.devart.com/company/contact.html).
Posted: Wed 02 Sep 2009 18:39
by ColinBo
I am using the latest version, I have emailed off the sample.
Posted: Wed 22 Dec 2010 08:35
by gsommer
I have the same problem in dotConnect 5.70.146.0 (at least it looks very much like it) and I have also reported to Devart with a sample last friday. Currently I am waiting for a response.
Has this problem been solved for You?
Posted: Wed 22 Dec 2010 16:35
by Shalex
1.
gsommer, sorry for the delay. Your e-mail was blocked by our e-mail system, and we have started processing it only after your post in this thread. Your project works fine in our environment (Oracle Server v 10.2, Oracle Client v 10.2, dotConnect for Oracle v 5.70.146). We are investigating the possible reasons of the error you have got. Please try at your side the following steps to localize the problem:
a) connecting in the Direct mode:
http://www.devart.com/dotconnect/oracle ... tMode.html;
b) if possible, try using different Oracle Server and/or Oracle Client.
Does the problem persist in this case as well?
2. As for ColinBo's project, there should be used
Code: Select all
public DevartDataOracleDriver()
: base("Devart.Data.Oracle", "Devart.Data.Oracle.NHibernate.NHibernateOracleConnection", "Devart.Data.Oracle.NHibernate.NHibernateOracleCommand") { }
istead of
Code: Select all
public DevartDataOracleDriver()
: base("Devart.Data.Oracle", "Devart.Data.Oracle.OracleConnection", "Devart.Data.Oracle.OracleCommand") { }
as we mentioned in this thread and in
our blog.
Posted: Wed 22 Dec 2010 16:42
by Shalex
The only change I have made in your project is adding log4net.dll v 1.2.10.0 to the ConsoleApplication1\Dependencies\NHibernate\2.1.2-GA\ folder.
Posted: Mon 27 Dec 2010 09:15
by Shalex
We have reproduced the error. We are investigating this issue.
Posted: Wed 19 Jan 2011 10:40
by Shalex
We have fixed the problem. Solution will be available in the next build. I will post here when it is available for download.
Additionally to our fix, you should change Program.DatabaseConnection() in your Program.cs
Code: Select all
private static DbConnection DatabaseConnection
{
get
{
return new OracleConnection(
DatabaseConnectionString);
}
}
to
Code: Select all
private static DbConnection DatabaseConnection
{
get
{
DbConnection con = new DevartOracleDriver().CreateConnection() as DbConnection;
con.ConnectionString = DatabaseConnectionString;
return con;
}
}
Posted: Thu 27 Jan 2011 16:04
by Shalex
New version of dotConnect for Oracle 6.10 is released!
It can be downloaded from
http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with valid subscription only):
http://secure.devart.com/ .
For more information, please refer to
http://www.devart.com/forums/viewtopic.php?t=20115 .