Using with NHibernate / Fluent NHibernate
Using with NHibernate / Fluent NHibernate
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
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
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:
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:
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?
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 ":"; }
}
}
}
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
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.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?
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).
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
istead of
as we mentioned in this thread and in our blog.
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") { }
Code: Select all
public DevartDataOracleDriver()
: base("Devart.Data.Oracle", "Devart.Data.Oracle.OracleConnection", "Devart.Data.Oracle.OracleCommand") { }
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
to
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);
}
}
Code: Select all
private static DbConnection DatabaseConnection
{
get
{
DbConnection con = new DevartOracleDriver().CreateConnection() as DbConnection;
con.ConnectionString = DatabaseConnectionString;
return con;
}
}
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 .
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 .