Hi all,

I've an assembly for all of my models that maps to two different 
databases using ActiveRecord. This assembly is called from a console 
application for testing purposes. All is fine if I only use 
ActiveRecord, but as soon as I use some data type from NHibernate 
namespace the console application fails at the first line of code:

XmlConfigurationSource config = new 
XmlConfigurationSource("nhibernate.config");

This line throws a NullReferenceException (without any additional info). 
The model's assembly has references to both NHibernate and ActiveRecord 
assemblies. The console application has the following nhibernate.config 
file:

<activerecord isWeb="false">

  <config type="Cae.Internal.Models.AdministrationDatabase`1, 
Cae.Internal.Models">
    <add key="connection.driver_class" 
value="NHibernate.Driver.NpgsqlDriver" />
    <add key="dialect" value="NHibernate.Dialect.PostgreSQLDialect" />
    <add key="connection.provider" 
value="NHibernate.Connection.DriverConnectionProvider" />
    <add key="connection.connection_string" 
value="Server=localhost;Database=test;User 
ID=test;Password=test;Encoding=SQL_ASCII" />
  </config>
 
  <config type="Cae.Internal.Models.InvoicingDatabase`1, 
Cae.Internal.Models">
    <add key="connection.driver_class" 
value="NHibernate.Driver.MySqlDataDriver" />
    <add key="dialect" value="NHibernate.Dialect.MySQLDialect" />
    <add key="connection.provider" 
value="NHibernate.Connection.DriverConnectionProvider" />
    <add key="connection.connection_string" value="Data 
Source=localhost;Database=test;User ID=test;Password=test" />
  </config>

</activerecord>

If I don't use any data types from NHibernate namespace all is fine, but 
I need to use DetachedCriteria :(

In the model assembly I'm using ActiveRecordBase<T> as the base class 
for my different abstract classes to use multiple databases, ie:

[ActiveRecord]
public abstract class AdministrationDatabase<T> : ActiveRecordBase<T>
{
}

Does somebody have an idea of where is the problem?

Thank you

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to