-->
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.  [ 8 posts ] 
Author Message
 Post subject: NHibernate and Firebird - no connect
PostPosted: Fri Nov 10, 2006 6:21 am 
Newbie

Joined: Fri Nov 10, 2006 6:04 am
Posts: 6
Location: Dortmund
hallo,

i'm using Firebird 1.5 and C# with Visual Studio 2005. i would like to use NHibernate for or-mappings.
i've created a new application project with a mapping class and the corresponding xml file. the connection parameters are in the app.config which looks like this:

Code:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section
      name="nhibernate"
      type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
    />
  </configSections>

  <nhibernate>
    <add
      key="hibernate.connection.provider"
      value="NHibernate.Connection.DriverConnectionProvider"
    />
    <add
      key="hibernate.dialect"
      value="NHibernate.Dialect.FirebirdDialect"
    />
    <add
      key="hibernate.connection.driver_class"
      value="NHibernate.Driver.FirebirdClientDriver"
    />
    <add
      key="hibernate.connection.connection_string"
      value="DataSource=QUARK;Database=DataTest;User=SYSDBA;Password=masterkey;ServerType=0;initial catalog=nhibernate;Integrated Security=SSPI"
    />
  </nhibernate>
</configuration>


i've made a reference to the FirebirdSql.Data.FirebirdClient (version 2.0.1.0) in the project map.

but every time i try to instantiate the factory with:

Code:
Configuration cfg = new NHibernate.Cfg.Configuration();
ISessionFactory factory = cfg.BuildSessionFactory();


i get this error

Could not create the driver from NHibernate.Driver.FirebirdClientDriver

i've read the post

http://forum.hibernate.org/viewtopic.php?p=2328099&sid=5525e924e9e78826576badaabe45a5fa in this forum, but it doesn't seem to help.

please help!!!![/quote]


could it be that nhibernat only supports .Net 1.1? i'm using .Net 2.0.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 10, 2006 1:15 pm 
Beginner
Beginner

Joined: Fri Oct 20, 2006 8:02 am
Posts: 36
yes, just install the firebird driver for .net 1.1 and try again


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 13, 2006 3:24 am 
Newbie

Joined: Fri Nov 10, 2006 6:04 am
Posts: 6
Location: Dortmund
My problem ist, that i have to use .Net 2.0. Is there any solution? If not, i must try another or mapping.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 15, 2006 1:50 pm 
Newbie

Joined: Tue Oct 11, 2005 12:20 pm
Posts: 4
Hi, I have running NH+firebird embedded with this mapping file:

Code:
<nhibernate>
    <add key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider"/>
    <add key="hibernate.connection.driver_class" value="NHibernate.Driver.FirebirdClientDriver"/>
    <add key="hibernate.dialect" value="NHibernate.Dialect.FirebirdDialect"/>
    <add key="hibernate.connection.connection_string" value="ServerType=1;User=sysdba;password=masterkey;Database=c:\mydatabase.fdb;Pooling=false"/>
    <add key="hibernate.query.substitutions" value="true 1, false 0, yes 1, no 0"/>
    <add key="hibernate.show_sql" value="true"/>
  </nhibernate>


Where FirebirdSql.Data.FirebirdClient.dll and fbembed.dll must be in the ouput directory of the app.
You can put it them as item in the project an mark as "always copy" or "copy if newer". The build action must be "none".

Tell me if this not work


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 16, 2006 3:31 am 
Newbie

Joined: Fri Nov 10, 2006 6:04 am
Posts: 6
Location: Dortmund
No, i don't work. the problem is that i'm using Firebird provider dll 2.0.0 and nhibernat supports only to 1.7 which is the other way around only for .net 1.1 and i'm running on .Net 2.0.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 16, 2006 6:42 am 
Beginner
Beginner

Joined: Wed Mar 22, 2006 6:59 am
Posts: 30
see shenning,

here i´m using the nhibernate 1.2 beta under .net 2, and it is ready to use Firebird provider 2.0... please try using this nhibernate version

bye


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 16, 2006 7:20 am 
Newbie

Joined: Fri Nov 10, 2006 6:04 am
Posts: 6
Location: Dortmund
pauloquicoli wrote:
see shenning,

here i´m using the nhibernate 1.2 beta under .net 2, and it is ready to use Firebird provider 2.0... please try using this nhibernate version

bye


i've downloaded the beta 1.2 and referenced the NHibernate.dll from directory bin\net-2.0.

But if i try to instanciate a Configuration

Code:
NHibernate.Cfg.Configuration cfg = new NHibernate.Cfg.Configuration();


i get the message that the type initializer from Hibernate.Cfg.Configuration has caused an exception. what have i to consider?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 16, 2006 8:54 am 
Newbie

Joined: Tue Oct 11, 2005 12:20 pm
Posts: 4
You did try with what i tell you in the previous post ?

Try with this provider

And dont reference the FirebirdSql.Data.FirebirdClient.dll, just copy them to app output directory (where is you .exe)

I have using the 1.20alfa, and it work, yesterdey i get the svn version, and..still work. Forget version of NH. NH works.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 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.